Update get_next_player_to_play()
This commit is contained in:
parent
4f88097937
commit
26fd5b1d5b
1 changed files with 3 additions and 2 deletions
|
@ -107,11 +107,12 @@ void free_utictactoe(s_utictactoe *p_uttt){
|
||||||
}
|
}
|
||||||
|
|
||||||
e_player get_next_player_to_play(s_utictactoe *p_uttt) {
|
e_player get_next_player_to_play(s_utictactoe *p_uttt) {
|
||||||
|
|
||||||
if ( p_uttt->outer_tictactoe->winner != NOBODY ) {
|
if ( p_uttt->outer_tictactoe->winner != NOBODY ) {
|
||||||
return NOBODY;
|
return NOBODY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( p_uttt->history->last_move->player == PLAYER_O ||
|
if ( (p_uttt->history->last_move && p_uttt->history->last_move->player == PLAYER_O) ||
|
||||||
p_uttt->history->last_move == NULL ) {
|
p_uttt->history->last_move == NULL ) {
|
||||||
return PLAYER_X;
|
return PLAYER_X;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue