Logo BASIC - the best thing ever

created by Grok Programming


Super short intro

Enter code into the text box, then click the "ready" button. An overlay will appear over the text box.
- Then using the links at the top of the overlay -- step, run and pause -- you can watch the code execute.
- or, click "ready & run"

You can have multiple functions, but there should always be a function called "main" where the program will start.

Bear in mind this software is still in development. There's a lot yet to be done, and bugs to be fixed. If you do get an error, it is prudent to reload the page.

Logo commands:
fd x - move forward x pixels
bk x - move back x pixels
rt x - turn clockwise x degrees
lt x - turn counter-clockwise x degrees
pu() - pen up (move but don't draw)
pd() - pen down (move and draw)
home() - move to the center of the canvas
setX n & setY n - set the x or y location
setWeight x - set the size of the pen
setPPF x - set how many pixels (i.e. how far) the turtle can move each frame
setAPF x - set how many degrees the turtle can turn each frame
setAngle x - change orientation to x

BASIC commands:
var label - declare a variable named label
math operations: +, -, /, +
to assign a value to a variable, use =
var++ is equivalent to var = var + 1
to test if two values are equal, use ==
or != to see if two values are not equal
test if one value is larger or smaller than another with < and >

if ( condition )

while ( condition )

Built in functions
alert( x ) - display the value x
input( x ) - displays the message x, prompts the user for a value, and returns it
sqrt( x ) - returns the square root of x

function name ( parameters (optional) )

return x - returns the value x from a function (but currently does not halt execution of the function)