Lab3a Example's Code

Created by: Mr. Jeff Goldstein

world

Events

When the world starts
Do:
world.classExample


Methods

  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