Home
Project Folders
Teacher Resources
Student Resources
En ESPAÑOL
How Do I?
Vocabulary
MWForum
Site Map
Search
Our Team

race cars 1 2 3 4 5 6
Race Cars 3
Download
5 KB


Goal:   Two cars race at random speeds, so we don´t know who will get ahead.


Screenshot


Vocabulary:   random

Code
Shapes
Project Map

code


Notes

In this project, we use the same procedures as in Race Cars 2, but we change the instructions to the turtles.

  1. Make the OnClick rule of each turtle say fd random 5.   Set them to Forever.

    Random 5 means, "Choose a number that is 0 or higher but is less than 5."   The computer will randomly choose 0, 1, 2, 3, or 4.   The computer chooses randomly for each car, over and over again.   So we don't know which car will go faster, or if they will go at the same speed, or if one car will be faster for awhile and then the other car will pass it.

  2. Press the go! button and watch the cars race!




What If?
Try setting one car's rule to fd 2 and the other car's rule to fd random 5.   What happens in the race?


Challenge
Can you make the cars move faster or slower while still using random?


On Your Own - Project Ideas
Animate other shapes to move at random speeds in another scene.





© copyright 2001 - 2016  OpenWorld Learning.   All rights reserved.