can't play on completed boards
このコミットが含まれているのは:
コミット
77fb778d0b
3
uttt.c
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));
|
||||
|
|
読み込み中…
新しいイシューから参照