Tobis Programm forked to not destroy your golden files

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
129:0f60bf9640bb
Parent:
128:6bde4483ce7b
Child:
130:670a954495bf
--- a/source/Pathfinding.cpp	Sun May 14 14:40:12 2017 +0000
+++ b/source/Pathfinding.cpp	Mon May 15 11:48:05 2017 +0000
@@ -60,10 +60,10 @@
     open_list_count = 0;
     counter = 0;
 
-    // check if position is reachable
+    // check if position isn't reachable
     if (obstacle_list[start.x][start.y] == 1 || start.x > row || start.y > col ||
             obstacle_list[target.x][target.y] == 1 || target.x > row || target.y > col) {
-        printf("Fatal Error, no path calculation possible\n");
+        printf("Fatal Error, no path calculation possible, line 66\r\n");
         return no_path_possible;
     } else {
         position diff;
@@ -86,18 +86,21 @@
             open_list_count -= 1;
 
             if (open_list[start.x][start.y] == 65535) {                 // if we added the destination to the closed list, we've found a path
-                printf("Path found\n\n");                               // PATH FOUND
+                printf("Path found, line 89\r\n");                     // PATH FOUND
                 break;                                                 // break the loop
             }
             calc_F(target, start, current);                             // Calculates F for each neighbour of current lowest F
 
         } while (!(open_list_count == 0));                              // Continue until there is no more available square in the open list (which means there is no path)
         if (open_list[start.x][start.y] != 65535) {                     // if we added the destination to the closed list, we've found a path
-            printf("No Path possible\n");
+            // no path found
+            printf("No Path possible, line 97\r\n");
+            print_map();
             return no_path_possible;
         } else {
+            // path found
             mapp_path(start);                                           //mapps the path onto the open_list, be replaced by position vector array;
-            printf("\nPath from (%d:%d) to (%d:%d) has a total of %d steps\n\n", start.x, start.y, target.x, target.y, counter);
+            printf("\nPath from (%d:%d) to (%d:%d) has a total of %d steps\r\n", start.x, start.y, target.x, target.y, counter);
             return path_found;
         }
     }
@@ -152,7 +155,7 @@
             case 4:
                 adjacent.x = current.x - 1;
                 adjacent.y = current.y - 1;
-                numb = 3;   // top left
+                numb = 3;                               // top left
                 corner1.x = current.x - 1;
                 corner1.y = current.y;
                 corner2.x = current.x;