VIEWS: 0 PAGES: 7 POSTED ON: 5/8/2013
Repetition - Looping Control Structures Sequential • Do Together • Do In Order Conditions / Decisions Repetition / Loop • Counted • While Loop Looping Repeating Behavior • Sequential Instructions • Methods Counted Loop Know how many times we need a block of instruction to repeat • Jump up and down 5 times • Uses a Counter Example Create a world with a Ferris Wheel. When the space bar is pushed, have the ferris wheel move around 5 times. While Loops Repeating block of instructions Unspecified number of times • While a condition is true • While it is raining, use an umbrella • While the troll is more than 5 meters from the dragon, move toward dragon Ferris Wheel – While Loop Modify the ferris wheel program to continue going around until a switch is turned off.
Pages to are hidden for
"Repetition - Looping"Please download to view full document