Tutorial Guide

36
Lesson 4 Intermediate Course
4 Move the WALK_BOW box and the END boxes
downward.
2 Setting branch conditions in branch boxes
In this lesson, youll create a box defining the following branch
condition.
If the head was pressed, AIBO bows. If not, the program jumps to
another box.
1 Click the box and place it between the
STAND and WALK_BOW boxes.
2 Enter the box name and command, and then
close the Properties box.
Name : TOUCH_HEAD?
1 Enter the command, if the head was pressed, jump to the
WALK_BOW action box.
Type Variable Op Var/Value JumpTo
IF Head_ON = 1 WALK_BOW
2 Enter the command, If the head was not pressed.
Type JumpTo
ELSE null*
To move 2 boxes at the same time,
select them by dragging the mouse
to enclose them. Then move them
by dragging them to make a space
between the STAND and
WALK_BOW boxes.
This creates a program that
determines whether the head
sensor was pressed or not, and
then jumps to the next action.
If AIBOs head was pressed
(HEAD_ON=1), jump to the
WALK_BOW box.
If else, jump to null.
* The box that the program jumps
to will be created at a later stage,
so select null, which signifies
not yet determined.
When you make a box and
connect the two boxes with a
line, the null will be
automatically changed to the
name of the connected box.
A branch box displays two
terminals since it has two branch
conditions.
The jump destination
is specified in step 1,
so the boxes are
connected with a line
automatically.