checks the right board for win after move

このコミットが含まれているのは:
woosh 2023-11-12 11:58:58 +00:00
コミット 14d8c75790
1個のファイルの変更1行の追加1行の削除

2
uttt.c
ファイルの表示

@ -85,7 +85,7 @@ int ut_move(struct ut_state *new_state, const struct ut_state *old_state, int ro
// do move
new_state->tiles[row][col] = old_state->player;
new_state->boards[row / 3][col / 3] = ut_winner((char *)new_state->tiles, 27 * (row % 3) + 3 * (col % 3), 9);
new_state->boards[row / 3][col / 3] = ut_winner((char *)new_state->tiles, 27 * (row / 3) + 3 * (col / 3), 9);
// next play board - if next play board is not playable, play any board
new_state->playBoard = new_state->boards[row % 3][col % 3] == '\0' ? 3 * (row % 3) + (col % 3) : -1;