22deb96a41a7e7a06ede4fb8462c2d98fecea892
2 * =====================================================================================
6 * Description: Routines to handle the display
9 * Created: 15/03/2017 20:06:11
13 * Author: Jerome Benoit (fraggle), jerome.benoit@piment-noir.org
14 * Organization: Piment Noir
16 * =====================================================================================
21 /* in all print routine, y and x are the coordinates of the first character of the shape
22 * which can be a space ' ' */
24 void print_board(int y
, int x
) {
25 mvprintw(y
, x
, " | |");
26 mvprintw(y
+1, x
, " | |");
27 mvprintw(y
+2, x
, "----+----+----");
28 mvprintw(y
+3, x
, " | |");
29 mvprintw(y
+4, x
, " | |");
30 mvprintw(y
+5, x
, "----+----+----");
31 mvprintw(y
+6, x
, " | |");
32 mvprintw(y
+7, x
, " | |");
35 /* there's only nine valid (y, x) 2-uplets for this two shapes
36 * that are : - base_y, base_x +1
37 * - base_y, base_x + 6
38 * - base_y, base_x + 11
39 * - base_y + 3, base_x + 1
40 * - base_y + 6, base_x + 1
41 * - base_y + 3, base_x + 6
42 * - base_y + 3, base_x + 11
43 * - base_y + 6, base_x + 6
44 * - base_y + 6, base_x + 11
45 * The added y value can be {0, 3, 6}
46 * The added x value can be {1, 6, 11} */
48 void print_x(int y
, int x
) {
49 mvprintw(y
, x
, "\\/");
50 mvprintw(y
+1, x
,"/\\");
53 void print_o(int y
, int x
) {
54 mvprintw(y
, x
, "/\\");
55 mvprintw(y
+1, x
, "\\/");