Yashushi Fujita and Jesse Higginson want to know how to control multiple
turtles. Here, in PC Logo 2, is an activity I developed for children
studying probability. There are six turtles having a race, the use of
random numbers ensuring that the outcome of each race is determined purely
by chance.
TO RACE
CS CT SETBG BLACK
ASK 6 [SETPC RED PU SETPOS [300 100] PD SETPOS [300 -100]]
TURTLECOLUMN 6
EACH [HT PU BK 300 PD SETPC WHO + 9 TT WHO + 1 PU FD 30 ST]
PPR [WRITE DOWN THE NUMBER OF THE TURTLE YOU PREDICT WILL WIN.]
PPR [WHEN YOU ARE READY, PRESS ANY KEY TO START THE RACE.]
IGNORE RC
FS ASK 6 [PU HOME PD SETPC GREEN SETFONT "POSTER 36 1 TT [GO!] WAIT
100 PE TT "GO!]
RACE.THEM
WAIT 200 CT SS
PPR [IF YOU WANT TO QUIT THIS GAME, PRESS "Q ". PRESS ANY OTHER KEY IF
YOU ARE READY FOR ANOTHER RACE.]
MAKE "CHOICE RC
IF :CHOICE = "Q THEN CT PR [THE TURTLES SAY, "THANKS. WE ENJOY
RUNNING! "] TOPLEVEL
RACE
END
TO RACE.THEM
REPEAT 325 [ASK (-1 + RANDOM 6) [FD 10 WAIT RANDOM 10 IF XCOR = 300
THEN STOP]]
END
John Hayes
Te Puke Primary School
New Zealand
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org. Mail
questions about the list administration to logofdn@gsn.org. To
unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home