to checkhit ; We check if we hit the target by comparing our guess to the distance ; If we hit it, we stop. If we didn't hit it, we move the cursor ; back to the origin and do it again. (if :guess = :distance [print [Safe Landing!!!] stop]) print [Missed, try again!] back :guess playgame end to drawtarget ; This draws the target, which is just a box. Notice ; that we put the pen up before moving to the target location, ; then, after we draw the box, we move back to the origin penup forward :distance pendown left 90 forward 5 right 90 repeat 3 [fd 10 rt 90] forward 5 right 90 penup back :distance end to getguess ; We get the guess as just one word. Notice that it does use a box. print [How far is the target:] make "guess readword end to launch ; This actually launches the rocket by drawing a line the length of guess. pendown forward :guess end to pickdistance ; Here, the program sets the distance to the target. We use 40 ; for testing, but after testing, we will use a random primative. make "distance 40 end to playgame ; These are the series of actions to play the game. getguess launch checkhit end to rocket ; We use rocket to start the game. setup playgame end to setup ; setup initializes everything, including clearing the screen. CS pickdistance drawtarget end