# Option play-slam Implements normale slam behaviour and button reaction. ## State Machine ## State play-slam
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| leds.head-white | = | head-white.lloo
| challenge-slam.state | = | challenge-slam.state.slam-start
| sound-request | = | sound-request.none
| head-control-mode | = | head-control-mode.look-between-feet
The decision tree:
Pseudo code of the decision tree:
if ( | robot-state.head-button-pressed-short | ) | //
{
transition-to-state(use-new-flags);
}
else
{
transition-to-state(play-slam);
}
## State learn-flags
If that state is active,
> | The option handle-with-old-flags is executed.
> | These output symbols are set:
| leds.head-white | = | head-white.oooo
| challenge-slam.state | = | challenge-slam.state.learn-new-flags
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution < 60000 | ) | //
{
transition-to-state(learn-flags);
}
else
{
transition-to-state(wait-for-second-part);
}
## State wait-for-second-part
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| leds.head-white | = | head-white.lloo
| challenge-slam.state | = | challenge-slam.state.slam-start
| sound-request | = | sound-request.none
| head-control-mode | = | head-control-mode.look-between-feet
The decision tree:
Pseudo code of the decision tree:
if ( | robot-state.head-button-pressed-short | ) | //
{
transition-to-state(use-new-flags);
}
else
{
transition-to-state(wait-for-second-part);
}
## State use-new-flags
If that state is active,
> | The option handle-with-new-flags is executed.
> | These output symbols are set:
| leds.head-white | = | head-white.oooo
| challenge-slam.state | = | challenge-slam.state.use-new-flags
| sound-request | = | sound-request.klick
The decision tree:
Pseudo code of the decision tree:
transition-to-state(use-new-flags);

## State finished

If that state is active,
> | The basic behavior special-action is executed. Parameters:
| special-action-id | = | special-action.cheer-happy1 ;
The decision tree:
Pseudo code of the decision tree:
transition-to-state(finished);