summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b90882d)
* TODO: Note that ttt-server should retry a couple times if its
port is not available.
* src/test-board.c: (main): Remove debug print messages.
* src/ttt-board.c: (ttt_board_make_move): Tighten up the code just
a little bit more.
+2005-12-13 Carl Worth <cworth@cworth.org>
+
+ * TODO: Note that ttt-server should retry a couple times if its
+ port is not available.
+
+ * src/test-board.c: (main): Remove debug print messages.
+
+ * src/ttt-board.c: (ttt_board_make_move): Tighten up the code just
+ a little bit more.
+
2005-12-10 Richard D. Worth <richard@theworths.org>
* TODO: check off INVITE, RETRACT, DECLINE, Game Invitation
2005-12-10 Richard D. Worth <richard@theworths.org>
* TODO: check off INVITE, RETRACT, DECLINE, Game Invitation
----------
Server log messages should include pid date and time. And server
should log the fact when it gets terminated by a signal.
----------
Server log messages should include pid date and time. And server
should log the fact when it gets terminated by a signal.
+
+Server should wait and retry a couple of times if its port is not
+available, rather than just giving up.
+
printf ("\"\n");
printf ("Make a move \n");
printf ("\"\n");
printf ("Make a move \n");
- printf ("getchar returned a numeric value of %d which is character '%c'\n", m, m);
- m = m - '0';
ttt_board_make_move (&board, m);
}
ttt_board_make_move (&board, m);
}
ttt_error_t ttt_board_make_move (ttt_board_t *board, int move)
{
if (board->cells[move] != '_')
ttt_error_t ttt_board_make_move (ttt_board_t *board, int move)
{
if (board->cells[move] != '_')
- {
- return(TTT_ERROR_NOT_VALID_MOVE);
- }
+ return TTT_ERROR_NOT_VALID_MOVE;
+
+ board->cells[move] = board->current_player;
if (board->current_player == TTT_CELL_X)
if (board->current_player == TTT_CELL_X)
- {
- board->cells[move] = 'X';
board->current_player = TTT_CELL_O;
board->current_player = TTT_CELL_O;
- {
- board->cells[move] = 'O';
board->current_player = TTT_CELL_X;
board->current_player = TTT_CELL_X;
- }
- return(TTT_ERROR_NONE);
+
+ return TTT_ERROR_NONE;