Implement some basic debug printing function.
[Project_algorithmic_C.git] / lib / debug.c
CommitLineData
54f1c58c
JB
1/*
2 * =====================================================================================
3 *
4 * Filename: debug.c
5 *
6 * Description: Debugging functions
7 *
8 * Version: 1.0
9 * Created: 27/04/2017 12:58:37
10 * Revision: none
11 * Compiler: gcc
12 *
13 * Author: Jerome Benoit (fraggle), jerome.benoit@piment-noir.org
14 * Organization: Piment Noir
15 *
16 * =====================================================================================
17 */
18
19#include <string.h>
20
a80646b7 21#include "othello.h"
54f1c58c
JB
22#include "debug.h"
23
a80646b7 24void display_array(int base_y, int base_x, unsigned int pawn_array[board_size][board_size]) {
54f1c58c 25
a80646b7
JB
26 for (int i = 1; i <= board_size; i++) {
27 mvprintw(base_y + i, base_x, "%d", i);
28 for (int j = 1; j <= board_size; j++) {
29 mvprintw(base_y, base_x + j, "%d", j);
30 mvprintw(base_y + i, base_x + j, "%d", get_box_value(i, j, pawn_array));
31 }
32 }
54f1c58c 33}
bbbe0570 34
658c6acc
JB
35#if BUILD_TYPE == debug
36void dbg_mvprintv(int y, int x, char* debug_text) {
37 mvprintw(y, x, debug_text);
38}
39#else
40void dbg_mvprintv(int y, int x, char* debug_text) { }
41#endif