Tell the Turtle What to Do
Meet the turtle. It sits in the middle of the page and waits for you. Give it one command and it moves, leaving a line behind. That is what coding is: telling a computer what to do.
π‘ The idea
A command is one instruction that the computer obeys.
- A command is one short instruction, like forward 100.
- The number tells the turtle how far to go.
- forward goes ahead. back goes the other way.
- The turtle leaves a line wherever it walks.
- One command goes on one line.
π Words to know
- command
- one instruction for the computer
- forward
- go ahead and draw a line
- clear
- wipe the drawing away
π Watch this
One straight line, going up from the middle of the page.
forward 100
βοΈ Your turn
- Type forward 100 and press Run.
- Change 100 to 50 and run it again. Is the line shorter?
- Try forward 200.
- Try back 100 and watch the turtle walk backwards.
- Press clear to wipe the page and start again.
π― Challenge: Make the turtle go up, turn right, then go again.
Show me one answer
forward 100 right 90 forward 100
Your program