world.classExample ( )
numberRolls = 2 |
| |
// Assume the car and truck are in position & numberRolls is declared and set |
| // Ask the user how many rolls, today and assign it to the numeric variable |
| numberRolls set value to ( ask user for a number question = How many rolls, today? ) |
| // Car rolls for the number of times the user had input. |
| car roll left numberRolls revolutions duration = 5 seconds |
| // Re-assign the number of rolls to twice as many |
| numberRolls set value to ( ( numberRolls * 2 ) ) |
| // Truck rolls twice as many times as the car did. |
| cementTruck roll left numberRolls revolutions duration = 5 seconds |