A simple BASIC like interpreter in C++
- Variables
- Arithmetic operations
To open cppBASIC, run the following command:
./cppBASIC
This will open a terminal with the cppBASIC interpreter. You can now type in your BASIC code.
10 LET A = 5
20 LET B = 10
30 PRINT ADD A B
Then run this
RUN
The output will be:
15
RUN
: Run the programLIST
: List the programCLEAR
: Clear the screenNEW
: Clear the programQUIT
: Quit the interpreter
LET
: Assign a value to a variableLET A = 5
PRINT
: Print a valuePRINT A
GOTO
: Go to a line numberGOTO 10
WAIT
: Wait for a number of millisecondsWAIT 5
These can be used in the PRINT
and LET
command.
ADD
: Add two variablesADD A B
SUB
: Subtract two variablesSUB A B
MUL
: Multiply two variablesMUL A B
DIV
: Divide two variablesDIV A B
To build the project, run the following commands:
make
To clean the project, run the following commands:
make clean
This project is licenced under the GNU General Public Licence v3.0 - see the LICENCE file for details