Skip to content

cvhariharan/Tiny-Basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiny Basic Interpreter

A tiny basic interpreter in C. Does not follow the exact language spec as I could not find a standard spec. Still a WIP. You can read about the intepreter here

  • Implement the grammar (some commands omitted)
  • Comments
  • Error reporting
build/tbc examples/fibonacci.tb

Example Programs

Fibonacci

REM This code prints n fibonacci numbers
LET a = 0
LET b = 1
LET n = 10

REM This is how loops work for now
100 PRINT a
IF n == 0 THEN END
LET t = b
LET b = a + b
LET a = t
LET n = n - 1
GOTO 100

Gimme some stars

PRINT "How many stars do you want?"
LET stars = 0
INPUT stars
10 IF stars == 0 THEN END
PRINT "*"
LET stars = stars - 1
GOTO 10

About

A tiny and basic TINY-BASIC interpreter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published