PES 2 - Gruppe 1 / Mbed 2 deprecated Robocode_Random

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
119:eb212467afb0
Parent:
117:66d64dbd1b36
Parent:
113:c8ea0cd9b20c
Child:
120:cdf7a6751f9e
diff -r fbd6d41f6ce8 -r eb212467afb0 source/Main.cpp
--- a/source/Main.cpp	Fri May 12 08:29:53 2017 +0000
+++ b/source/Main.cpp	Fri May 12 08:33:04 2017 +0000
@@ -39,8 +39,8 @@
         //Every function will return the next active state upon its transition table.
         //State and Transition Table can be found in the State_Machine.xlsx
         //*******************************************************************************
-        
-        
+
+
         //printf("state: %d\r\n",state);
         switch (state) {
             case 0:
@@ -149,7 +149,7 @@
                 state = 101;
                 break;
             case 102:
-                move_for_distance_with_radius(1,-0.19);
+                move_for_distance_with_radius(0.5f,-0.4);
                 state = 103;
                 break;
             case 103:
@@ -157,9 +157,24 @@
                 if(distance < 0) {
                     //printf("remaining deg %f\r\n", deg);
                     stop_turn();
-                    state = 11;
+                    state = 104;
                 }
                 break;
+            case 104:
+                move_for_distance_with_radius(0.5f,0.4);
+                state = 105;
+                break;
+            case 105:
+                float distance2 = move_for_distance_with_radius(0,0);
+                if(distance2 < 0) {
+                    //printf("remaining deg %f\r\n", deg);
+                    stop_turn();
+                    state = 106;
+                }
+                break;
+            case 106:
+                coordinates co = get_current_coord();
+                printf("current_coord: %f || %f\r\n", co.x, co.y);
 
         }
     }