can't play on completed boards

このコミットが含まれているのは:
ninya9k 2023-11-13 10:22:19 +00:00
コミット 77fb778d0b
1個のファイルの変更3行の追加0行の削除

3
uttt.c
ファイルの表示

@ -89,6 +89,9 @@ int ut_move(struct ut_state *new_state, const struct ut_state *old_state, int ro
// bad move - tile is occupied
if(old_state->tiles[row][col] != '\0') {return 1;} // replace with ' ' maybe
// bad move - board is not playable
if(old_state->boards[row / 3][col / 3] != '\0') {return 1;} // replace with ' ' maybe
// copy old_state->{tiles,boards} to new_state->{tiles,boards}
memmove(new_state->tiles, old_state->tiles, sizeof(old_state->tiles));
memmove(new_state->boards, old_state->boards, sizeof(old_state->boards));