rows and columns are y and x
このコミットが含まれているのは:
コミット
78efac625e
6
uttt.c
6
uttt.c
|
@ -78,7 +78,7 @@ int ut_move(struct ut_state *new_state, const struct ut_state *old_state, int ro
|
|||
return 0;
|
||||
}
|
||||
|
||||
void show(const struct ut_state *state) {
|
||||
void ut_show(const struct ut_state *state) {
|
||||
#define tiles state->tiles
|
||||
printf("Turn: %c\nPlay board: %d\n", (int)state->player, state->playBoard);
|
||||
int play_board_row = -1;
|
||||
|
@ -179,8 +179,8 @@ int main(int *argc, char **argv) {
|
|||
};
|
||||
while (true) {
|
||||
int x, y;
|
||||
show(&state);
|
||||
bool ok = getpos(&state, &x, &y);
|
||||
ut_show(&state);
|
||||
bool ok = getpos(&state, &y, &x);
|
||||
if (!ok) {continue;}
|
||||
int err = ut_move(&state, &state, x, y);
|
||||
if (err) {continue;}
|
||||
|
|
読み込み中…
新しいイシューから参照