ClearAllBeepersToTheWall

Dependencies:   mbed

Committer:
GreenOrange
Date:
Fri Apr 24 08:17:17 2015 +0000
Revision:
1:427aa180d290
Parent:
0:6ff8c2bfa876
ClearAllBeepersToTheWall

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GreenOrange 0:6ff8c2bfa876 1 #include "mbed.h"
GreenOrange 0:6ff8c2bfa876 2 #include "ur_Bertl.h"
GreenOrange 0:6ff8c2bfa876 3
GreenOrange 0:6ff8c2bfa876 4 int main()
GreenOrange 0:6ff8c2bfa876 5 {
GreenOrange 0:6ff8c2bfa876 6 ur_Bertl karel;
GreenOrange 1:427aa180d290 7
GreenOrange 1:427aa180d290 8
GreenOrange 1:427aa180d290 9 for(int i = 0; i < 3; i++)
GreenOrange 0:6ff8c2bfa876 10 {
GreenOrange 0:6ff8c2bfa876 11 while(!karel.NextToABeeper())
GreenOrange 1:427aa180d290 12 {
GreenOrange 1:427aa180d290 13 karel.Move();
GreenOrange 1:427aa180d290 14 }
GreenOrange 0:6ff8c2bfa876 15
GreenOrange 1:427aa180d290 16
GreenOrange 1:427aa180d290 17 karel.PickBeeper();
GreenOrange 1:427aa180d290 18 karel.NibbleLeds(karel.AnyBeeperInBag());
GreenOrange 1:427aa180d290 19 wait(1);
GreenOrange 1:427aa180d290 20 if(i != 3)
GreenOrange 1:427aa180d290 21 {
GreenOrange 1:427aa180d290 22 while(karel.NextToABeeper())
GreenOrange 1:427aa180d290 23 {
GreenOrange 1:427aa180d290 24 karel.Move();
GreenOrange 1:427aa180d290 25 }
GreenOrange 1:427aa180d290 26 }
GreenOrange 0:6ff8c2bfa876 27 }
GreenOrange 0:6ff8c2bfa876 28 }
GreenOrange 0:6ff8c2bfa876 29