Swag Factory

“Das Claw!”

News

This morning a man in New Zealand got out of bed and had breakfast. Find out more here.

State Diagram top

Pseudocode top

Repeat forever

Repeat until coin is found
Check for coin
Check for hand
If music timer is expired
Stop music
Reset timer
If Hand is found (Hand is present, was not previously present, and music is not already playing)
Start music timer
Start music
End

Start game timer

Repeat until game timer expires or claw button is pushed
If music timer is expired
Stop music
Reset timer
Get X joystick input
Update X motor
Get Y joystick input
Update Y motor
If claw button is pushed
Drop claw
Close claw
Raise claw
Move claw above return chute
Open claw
End
End

The Code top

Click here for the entire code in pdf form.