This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: sequence of commands under the “then” branch: 1. If (touch sensor #1 is pressed) 1.1. Forward 1.0 second 1.2. Turn left 1.0 second 1.3. Dance 1 time 2. Else 2.1 Play note F for a ¼ beat 3. EndIf • Can we combine loops with conditionals? • Proper indentation is vital in order to understand the structure of the code. 7/11/2007 Nested Ifs • We have seen how loops can be nested, i.e. one loop inside another. Similarly, we can have nested Yes/No blocks. • What does the roverbot do when the code in this diagram is executed? • Can you write the pseudo-code for this? • Complex programs can be written by just combining three algorithmic constructs: sequence, loops and conditionals....
View Full Document
- Fall '07
- UCI race classifications, Tour de Georgia, Condition, Material conditional, Yes/No block