Welcome to KidCode! This guide will teach you everything you need to know to control Cody and create amazing drawings.
| Command | Syntax | Example | Description |
|---|---|---|---|
| Move | move forward <value> |
move forward 100 |
Moves Cody forward by a number of pixels. |
| Turn | turn <direction> <value> |
turn right 90 |
Turns Cody to the left or right by a number of degrees. |
| Say | say <value> |
say "Hello!" |
Displays a message in the output log. Can be a string or a variable. |
| Command | Syntax | Example | Description |
|---|---|---|---|
| Pen | pen <up / down> |
pen up |
Lifts the pen (to move without drawing) or lowers it (to draw). |
| Color | color <color_name> |
color "red" |
Changes the color of the pen. |
Supported Colors: "red",
"green", "blue", "yellow",
"orange", "purple", "black",
"white", "cyan", "magenta", "pink", "brown".
Use the set command to create a variable and give it a
value.
set <variable_name> = <value>
set size = 50| Operator | Description | Example |
|---|---|---|
+ |
Addition / String Concatenation |
set x = 10 + 5 say "Hello" + " World"
|
- |
Subtraction | set x = 10 - 5 |
* |
Multiplication | set x = 10 * 5 |
/ |
Division | set x = 10 / 5 |
== |
Is Equal To | if x == 10 |
!= |
Is Not Equal To | if x != 10 |
> |
Is Greater Than | if x > 10 |
< |
Is Less Than | if x < 10 |
repeat)repeat <times>
# code to repeat
end repeat
if/else)if <condition>
# code
else
# other code
end if
Group your code into reusable commands.
define square size
repeat 4
move forward size
turn right 90
end repeat
end define
square 50
Store a collection of items. Access with list_name[0].
set colors = ["red", "green", "blue"]
color colors[0]
In Step mode, Cody advances one event at a time. Press Enter to move to the next step.