Turtle Race Track

Do this on pencilcode.net

1. This program draws a round track, and positions the turtle on the starting line:

dot gold, 400
dot erase, 200
pen blue, 10
bk 200

pen null
fd 50
rt 90

The functions used are: dot, pen, bk, fd, and rt. Can you figure out how each of them work?

2. This will let you race the turtle around the track using arrow keys: (Add this code to the end)

speed Infinity
tick 60, ->
  if pressed "up" then fd 2
  if pressed "left" then lt 1
  if not touches gold
    write "Game Over"
    tick null

The indenting is important, because it puts indented code under the control of a command. tick 60, -> repeats the code indented under it. if controls the code indented under it.

Q1: ____________________

Q2: ____________________

________________________

Challenge 1 done: ____

Challenge 2 done: ____

Challenge 3 done: ____

Challenge 4 done: ____

3. Questions and Challenges:

Question 1. Which code runs when the up-arrow key is pressed?
Question 2. Where do you move the turtle to end the game?
Challenge 1. Can make the turtle go forward faster?
Challenge 2. Can you change the color of the track?
Challenge 3. Can you make the right-arrow key work?
Challenge 4. Can make it win when the turtle touches the blue line?