Modified the BASIC interpreter to support comments using #

and sol whitespace support (eg tabs or spaces for indentation)
This commit is contained in:
deadvey
2026-02-26 12:26:46 +00:00
parent 7eea8d0ce1
commit 54d0665456
5 changed files with 53 additions and 22 deletions

View File

@@ -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