40 likes | 312 Views
Flowol. Lighthouses don’t all have the same flash pattern Can you make your lighthouse flash with 3 long and 2 short flashes every 20 seconds? (There should be 1 second between each flash). Flowol. Let flashes = 0 Is flashes = 3? If No turn lamp on delay 2 seconds
E N D
Flowol Lighthouses don’t all have the same flash pattern Can you make your lighthouse flash with 3 long and 2 short flashes every 20 seconds? (There should be 1 second between each flash)
Flowol Let flashes= 0 Is flashes= 3? If No turn lamp on delay 2 seconds turn lamp off Let flashes= flashes+ 1 delay 1 second If Yes move on to next part of program To do this effectively you need to use repetition
Flowol Repetition allows you to repeat the same action a number of times. Set up a variable(Let flashes= 0) Check whether the variable has reached its upper limit Do the action Increase the variable by 1 each time
Flowol Key vocabulary: Repetition Variable Loop Condition Pseudo code