Properly implement the validation of a shot and reverse or flip the
[Project_algorithmic_C.git] / lib / debug.c
index a2bf9ee63242387fe8375c998fe5fa7ae1438c04..c7f4dfb48635cd174290557a6397c9d4c3938c62 100644 (file)
 
 #include <string.h>
 
+#include "othello.h"
+#include "constants.h"
 #include "debug.h"
 
-void dbg_mvprintw(int base_y, int base_x, const char* fmt, va_list varglist) {
+void display_array(int base_y, int base_x, unsigned int pawn_array[board_size][board_size]) {
 
-    mvprintw(base_y, base_x - snprintf(NULL, 0, fmt, varglist)/2, fmt, varglist);
+    for (int i = 1; i <= board_size; i++) {
+        mvprintw(base_y + i, base_x, "%d", i);
+        for (int j = 1; j <= board_size; j++) {
+            mvprintw(base_y, base_x + j, "%d", j);
+            mvprintw(base_y + i, base_x + j, "%d", get_box_value(i, j, pawn_array));
+        }
+    }
 }