Tobis Programm forked to not destroy your golden files

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
130:670a954495bf
Parent:
129:0f60bf9640bb
Child:
132:8ae08f41bb43
--- a/source/Pathfinding.cpp	Mon May 15 11:48:05 2017 +0000
+++ b/source/Pathfinding.cpp	Mon May 15 13:03:16 2017 +0000
@@ -95,7 +95,9 @@
         if (open_list[start.x][start.y] != 65535) {                     // if we added the destination to the closed list, we've found a path
             // no path found
             printf("No Path possible, line 97\r\n");
-            print_map();
+            print_map(0);
+            print_map(1);
+            print_map(2);
             return no_path_possible;
         } else {
             // path found
@@ -292,4 +294,25 @@
     }
 }
 
-
+//******************************************************************************
+/**
+ * prints map defined by list
+ * 0 = obstacle_list
+ * 1 = open_list
+ * 2 = target_list
+ * very slow, shouldn't be called in final code
+ * by Claudio Citterio
+**/
+void print_map(int list)
+{
+    // Debug function for printing the obstacle matrix on putty. 
+    for (int y = 0; y < col; y++) {
+        for (int x = 0; x < row; x++) {
+            if(list == 0)printf("%d ", obstacle_list[y][x]);
+            if(list == 1)printf("%d ", open_list[y][x]);
+            if(list == 2)printf("%d ", target_list[y][x]);
+        }
+        printf("\r\n");
+    }
+    printf("\r\n");
+}