Fix to the const definition
[Project_algorithmic_C.git] / lib / ui.c
index c5f83b7be7f05a2e4192b69f2ec2387d9f3945a6..c786772620be4e78df055a277c8f5507e78f989f 100644 (file)
--- a/lib/ui.c
+++ b/lib/ui.c
@@ -51,35 +51,43 @@ void print_board(int y, int x) {
     mvprintw(y+22, x, " -----+----+----+----+----+----+----+-----");
 }
 
-static void print_x(int y, int x, int type) {
-
-    mvprintw(y, x, "\\/");
-    mvprintw(y+1, x,"/\\");
-}
-
 static void print_o(int y, int x, int type) {
 
     mvprintw(y, x, "/\\");
     mvprintw(y+1, x, "\\/");
 }
 
-/* y = 1: y -> 0  x = 1: 1 -> 1
- * y > 2: y -> y + 3     2 -> +6 */
+/* will be used for pawn placement hints */
+static void print_x(int y, int x, int type) {
+
+    mvprintw(y, x, "\\/");
+    mvprintw(y+1, x,"/\\");
+}
 
+/* y = 1: y -> 0      x = 1: 1 -> 1
+ * y > 1: y -> y + 3  x > 1: x -> x + 5 */
 static int remap_y(int y) {
 
     if (y == 1) {
         return 0;
     } else if (y > 1) {
-        return y + 3;
+        return (remap_y(y -1) + 3);
     }
 }
 
 static int remap_x(int x) {
 
     if (x == 1) {
-        return 1;
-    } else if (x > 2) {
-        return x + 5;
+        return x;
+    } else if (x > 1) {
+        return (remap_x(x - 1) + 5);
+    }
+}
+
+void print_pawns(int pawn_array[board_size][board_size]) {
+    for (int i = 0; i < board_size; i++) {
+        for (int j = 0; j < board_size; j++) {
+            //mvprintw(i,  j, "pawn[%d][%d] = %d\n", i, j, pawn_array[i][j]);
+        }
     }
 }