Modified the BASIC interpreter to support comments using #
and sol whitespace support (eg tabs or spaces for indentation)
This commit is contained in:
16
data/fb.bas
16
data/fb.bas
@@ -1,9 +1,11 @@
|
||||
FOR A = 1 TO 100
|
||||
PRINT A ;
|
||||
B = A % 3
|
||||
C = A % 5
|
||||
IF B = 0 then PRINT "Fizz" ;
|
||||
IF C = 0 then PRINT "Buzz" ;
|
||||
PRINT ""
|
||||
# A cool fizzbuzz program
|
||||
PRINT "FizzBuzz!"
|
||||
FOR A = 1 TO 16
|
||||
PRINT A ; # Prints the number
|
||||
B = A % 3
|
||||
C = A % 5
|
||||
IF B = 0 then PRINT "Fizz" ;
|
||||
IF C = 0 then PRINT "Buzz" ;
|
||||
PRINT ""
|
||||
NEXT A
|
||||
END
|
||||
|
||||
Reference in New Issue
Block a user