August 2010
Intermediate to advanced
288 pages
13h 21m
English
The flow of your program is as important as the configuration of the blocks. You use the Switch block to make decisions, allowing you to choose between two groups of blocks. By nesting Switch blocks, you can extend the number of choices, as in the LineFollower2 program.
The other major flow control block is the Loop block, which allows you to repeat a group of blocks until a certain condition is reached. Much of the power of the NXT-G language comes from the flexibility you have in specifying the conditions for both of these blocks. The condition is usually based on a sensor reaching a set trigger value, although you can also configure the Loop block to repeat for a certain number of repetitions or a set amount of time.
You can also use ...