--- /dev/null
+/*
+ * =====================================================================================
+ *
+ * Filename: constants.h
+ *
+ * Description: Header for constant values
+ *
+ * Version: 1.0
+ * Created: 24/04/2017 21:06:32
+ * Revision: none
+ * Compiler: gcc
+ *
+ * Author: Jerome Benoit (fraggle), jerome.benoit@piment-noir.org
+ * Organization: Piment Noir
+ *
+ * =====================================================================================
+ */
+
+/* exported const definitions */
+const int empty = 0;
+const int white = 1;
+const int black = 2;
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]);
+ }
}
}
#include <ncurses.h>
#include "ui.h"
+#include "othello.h"
int main() {
int row = 0, col = 0;
/* center the board */
int center_board_y = row/2 - 23/2;
- int center_board_x = col/2 - 40/2;
+ int center_board_x = col/2 - 41/2;
do {
print_board(center_board_y, center_board_x);