Set inner_ttt winner correctly in play_move()
This commit is contained in:
parent
f4fb6f5137
commit
3a020073f9
1 changed files with 3 additions and 6 deletions
|
@ -231,15 +231,12 @@ e_status play_move(s_utictactoe *p_uttt, s_move *p_move) {
|
||||||
p_uttt->history = value;
|
p_uttt->history = value;
|
||||||
|
|
||||||
if ( p_uttt->inception_level != 1 ) {
|
if ( p_uttt->inception_level != 1 ) {
|
||||||
}
|
|
||||||
else {
|
|
||||||
p_uttt->inner_tictactoes[p_move->outer_position]->content[p_move->inner_position] = p_move->player;
|
p_uttt->inner_tictactoes[p_move->outer_position]->content[p_move->inner_position] = p_move->player;
|
||||||
set_tictactoe_winner(p_uttt->inner_tictactoes[p_move->outer_position]);
|
set_tictactoe_winner(p_uttt->inner_tictactoes[p_move->outer_position]);
|
||||||
|
|
||||||
//check if we have a winner in inner_ttt then set player to outer
|
//check if we have a winner in inner_ttt then set player to outer
|
||||||
if ( p_uttt->inner_tictactoes[p_move->outer_position]->winner != NOBODY ) {
|
p_uttt->outer_tictactoe->content[p_move->outer_position] = p_uttt->inner_tictactoes[p_move->outer_position]->winner;
|
||||||
p_uttt->outer_tictactoe->content[p_move->outer_position] = p_move->player;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
p_uttt->outer_tictactoe->content[p_move->outer_position] = p_move->player;
|
p_uttt->outer_tictactoe->content[p_move->outer_position] = p_move->player;
|
||||||
set_tictactoe_winner(p_uttt->outer_tictactoe);
|
set_tictactoe_winner(p_uttt->outer_tictactoe);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue