Turtle Graphics
Commands
forward(d) |
fd |
backward(d) |
bk |
right(a) |
rt |
left(a) |
lt |
penup() |
pu |
pendown() |
pd |
goto(x, y) |
|
color(c) |
|
penwidth(w) |
|
home() |
|
clear() |
|
show() |
|
frame() |
|
animate(fps) |
|
S(x=0) |
state |
Colours are CSS strings: 'red', '#3498db', 'hsl(120,70%,50%)'
Draw pictures by giving movement commands to a turtle that traces its path on a canvas. Edit any cell and press Shift+Enter (or click ▶) to run it.