|
|
Circle |
|
See the program |
How
to draw a square. Move forwards 20 meters, then turn
90 degrees. If you do this 4 times, you'll get a square.
To draw the circle shown here, we'll repeat "move
forwards 2 meters" and "turn 10 degrees"
36 times . You'll notice this exercise introduces you
to variables, an essential notion in programming.
|
|
|
Loop |
|
See
the program |
In
this exercise, 6 targets are set up in a regular pattern.
Use a repeat
loop to shoot them all. Move forwards, turn left, fire
the robot's canon, turn right and start again. Later
on, we'll come across a for
loop, which is more complicated. while
and do/while
loops will also be studied.
|
|
|
Drawing |
|
See
the program |
One
of the first exercises was to draw a square. Little
by little you'll be brought to more complicated figures.
This example shows a geometric figure made of 12 squares.
It brings up the concept of procedures.
The procedure Square()
is called upon 12 times to draw this stylish flower.
|
|
|
Maze |
|
See
the program |
Leading
a robot through a maze is a great classic. Your robot
will use its radar to check if there's an obstacle in
front of it, or to one side. Depending on the result,
it will figure out if it can move forwards or needs
to turn. This is a good example of how to use a conditional
if branch
instruction.
|
|
|
Path |
|
See
the program |
Your
robots can gather data from information posts set along the path. This information
is stocked in variables the robot can read as it goes. If you've got it right,
your droid will zigzag safely between pools of burning lava and sheer cliffs all
the way to the platform.
|
|
|
Array |
|
See
the program |
After
having studied simple variables (int
and float),
this exercise brings up the more complicated arrays.
Objects are stacked on 5 bases. Your robot must shift
them around and bring them back in the reverse order.
This means memorizing each object's position in a 1
dimensional array of 5 elements. Another exercise shows
how to use 2 dimensional arrays.
|
|
|
Motor |
|
See
the program |
Each
robot is equipped with 2 motors that drive it like a caterpillar's tracks. In
this exercise, you must spot the closest blue cross, and then figure out at what
speed each motor must run to drive the robot up to the cross. You'll notice how
smooth and elegant the robot's motions are.
|