]> git.cworth.org Git - ttt/blob - src/test-board.c
Deleted debugging code and changed return errors to fit protocol
[ttt] / src / test-board.c
1 /* Test ttt-board.c */
2
3 #include "ttt-board.h"
4
5 int
6 main (void)
7 {
8     ttt_board_t board;
9     int m, i, newline;
10
11     ttt_board_init (&board);
12     
13     for (i = 0; i <= 8; i++)
14     {
15         printf ("This is the board \"");
16         ttt_board_write (&board, stdout);
17         printf ("\"\n");    
18
19         printf ("Make a move \n");
20         m = getchar();
21         newline = getchar();
22         printf ("getchar returned a numeric value of %d which is character '%c'\n", m, m);
23         m = m - '0';
24         ttt_board_make_move (&board, m);
25     }
26
27     printf ("This is the board \"");
28     ttt_board_write (&board, stdout);
29     printf ("\"\n");    
30
31
32     return 0;
33 }