Skip to content
Snippets Groups Projects
Commit 77f8cc5c authored by remi.greub's avatar remi.greub
Browse files

amélioration du smartBot

parent c8125f21
Branches
No related tags found
No related merge requests found
......@@ -362,6 +362,7 @@ int SmartBot(){
//verifie que le coup est jouable
if((pos = put_free_cell(chfr, game.players[game.curr_player].symbol))>=0){
struct cell *tempCell = &game.cells[chfr][pos];
tempCell->symbol = game.players[game.curr_player].symbol;
if (Find_winner(game.cells, game.cells[chfr][pos]) == game.players[game.curr_player].symbol){
//1er cas : a trouvé le bon coup à jouer pour gagner
tempCell->symbol = EMPTY;
......@@ -374,6 +375,7 @@ int SmartBot(){
tempCell->symbol = EMPTY;
return chfr;
}
tempCell->symbol = EMPTY;
}
}
//3e cas : joue un coup au hasard
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment