GoToBeeper

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
GreenOrange
Date:
Fri Apr 24 08:19:02 2015 +0000
Parent:
0:20cee1035378
Commit message:
GoToBeeper

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 20cee1035378 -r 9728dfcc78fa main.cpp
--- a/main.cpp	Thu Apr 23 12:04:18 2015 +0000
+++ b/main.cpp	Fri Apr 24 08:19:02 2015 +0000
@@ -1,24 +1,20 @@
 #include "mbed.h"
 #include "ur_Bertl.h"
 
-int main()                                     //Main
+int main()                                     //ClearAllBeeperToTheWall
 {
-    int a = 0;
     ur_Bertl karel;
 
-while(1)
-    {
-        while(!karel.NextToABeeper())
-            {
-                karel.Move();    
-            }
-        
-        if(a <= 3)
-            karel.PickBeeper();
-            a++;
+    if ( !karel.NextToABeeper())
+        karel.Move();             
     
+    if ( !karel.NextToABeeper())
+        karel.Move();             
     
-    }
+    if ( !karel.NextToABeeper())
+        karel.Move();
+
+    karel.PickBeeper();
 }