This program is a skim version of the Logo Programming Language, coded as assignment for the Intermediate Programming course at the University of Guelph.
To compile this program type "make". The binary executable will be created on the 'bin' folder.
To run the program type "./bin/runMe"
To use this program, you need to type your inputs in the command line. Each command and its parameters must be separated by a space. You can type more than one command per line, but the line length is limited.
You can use 3 types of data. Any of these type can be stored in a variable (See the make command)
Any parameter formed only by numbers.
Examples:
1
-123
9829
Parameters true and false
Examples:
true
false
Any parmeter formed only by numbers and a single dot.
Examples:
-1.0
234.56
3.14159
Any parameter begining with a double quote.
Examples:
"CIS2500
"LogoIsFun
"ThatsWhatSheSaid
Available commands.
Creates a variable with the name and value passed as parameters
Usage:
make [ string ] [ int | float | string | bool ]
Plus arithmetic operation.
Usage:
[ int | float ] + [ int | float]
Minus arithmetic operation.
Usage:
[ int | float ] - [ int | float]
Times arithmetic operation.
Usage:
[ int | float ] + [ int | float]
Divide arithmetic operation.
Usage:
[ int | float ] / [ int | float]
and boolean operation
Usage:
and [ bool ] [ bool ]
or boolean operation
Usage:
or [ bool ] [ bool ]
Lesser than relational operation.
Usage:
[ int | float ] < [ int | float]
Less than or equal relational operation.
Usage:
[ int | float ] <= [ int | float]
Greater than relational operation.
Usage:
[ int | float ] > [ int | float]
Greater than or equal relational operation.
Usage:
[ int | float ] >= [ int | float]
Equal relational operation.
Usage:
[ int | float ] = [ int | float]
Not equal relational operation.
Usage:
[ int | float ] <> [ int | float]
Moves the turtle foward
Usage:
fd [ int | float ]
Moves the turtle backwards
Usage:
bk [ int | float ]
Rotate the turtle clockwise by the angle passed as parameter
Usage:
rt [ int | float ]
Rotate the turtle counter clockwise by the angle passed as parameter
Usage:
lt [ int | float ]
Disable the writing ability of the turtle
Usage:
pu
Enable the writing ability of the turtle
Usage:
pu
Moves the turtle to the coordinate passed as parameter
Usage:
setxy [ int | float ] [ int | float ]
Moves the turtle to the starting point of the board. Also resets its angle to 90 degrees
Usage:
home
Cleans the entire board
Usage:
clean
If the turtle is hidden, makes it visible again
Usage:
st
If the turtle is visible, makes it hidden
Usage:
ht
Changes the color of the turtle's pen
Usage:
setpencolor [ int ]
Creates a new file (name passed as parameter) and starts writing the user's commands in it
Usage:
beginfile [ string ]
Stops the writing of a file
Usage:
endfile
Load a file previously saved, and execute its commands
Usage:
loadfile [ string ]
Closes the program
Usage:
exit
- The turtle can't go out of the screen. If the user make an input that finishes outside the board, the turtle will stop at the border
- The max input is 90 characters (But there's no limit on the number of commands per line)