[Thread Prev] [Thread Next]
On 12 Nov 2002 at 21:42, Trish Sims wrote:
> I've been teaching year 8's (age 14) to use MicroWorlds. Lots of very
> successful projects but I'm having difficulty understanding and explaining
> the difference between proceedures that include
> when [touching? "t1 "t2] etc
> if [touching? "t1 "t2] etc
> These procedures are used to especially in races to program colour or to
> determine when/if turtles touch. Any suggestions would be greatly
> Trish Sims
> Strathmore Secondary College
"*When* checks continually to see if the condition in the first set of
brackets is true. "
... and it does so independently of the normal flow of the program. This
independent/continual check starts when the flow of the program reaches
the *when* primitive.
*If* only checks the condition when the flow of the program reaches the
*if* primitive. (image attached)
Description: GIF image
Previous by thread:
When or if
Next by thread:
When or if
To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.