mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-10 13:11:50 +09:00
basic: fixed a bug where empty string would be resolved to number zero; improving performance by building parsing trees prior to the actual execution
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
1 FOR I = 99 TO 1 STEP -1
|
||||
2 MODE = 1
|
||||
3 GOSUB 12
|
||||
4 PRINT(I+" bottle"+BOTTLES$+" of beer on the wall, "+i+" bottle"+BOTTLES$+" of beer.")
|
||||
4 PRINT I;" bottle";BOTTLES;" of beer on the wall, ";i;" bottle";BOTTLES;" of beer."
|
||||
5 MODE = 2
|
||||
6 GOSUB 12
|
||||
7 PRINT("Take one down and pass it around, "+(i-1)+" bottle"+BOTTLES$+" of beer on the wall.")
|
||||
7 PRINT "Take one down and pass it around, ";(I-1);" bottle";BOTTLES;" of beer on the wall."
|
||||
8 NEXT
|
||||
9 PRINT "No more bottles of beer on the wall, no more bottles of beer."
|
||||
10 PRINT "Go to the store and buy some more. 99 bottles of beer on the wall."
|
||||
11 END
|
||||
12 IF I == MODE THEN BOTTLES$ = "" ELSE BOTTLES$ = "s"
|
||||
12 IF I == MODE THEN BOTTLES = "" ELSE BOTTLES = "s"
|
||||
13 RETURN
|
||||
|
||||
Reference in New Issue
Block a user