summaryrefslogtreecommitdiffstats
path: root/clui.cpp
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-02-20 20:28:57 +0000
committerJoursoir <chat@joursoir.net>2021-02-20 20:28:57 +0000
commitc226da49d5d8fd06d12dd443262a6b85e3285aba (patch)
tree5e01fd35e8205335e631251b602bb215924f3117 /clui.cpp
parent6a0fc4c8c53f539cf0779ec750b0282db74c63d1 (diff)
downloadlp-gomoku-c226da49d5d8fd06d12dd443262a6b85e3285aba.tar.gz
lp-gomoku-c226da49d5d8fd06d12dd443262a6b85e3285aba.tar.bz2
lp-gomoku-c226da49d5d8fd06d12dd443262a6b85e3285aba.zip
add alpha–beta pruning; fix bugs: uncorrect random move
Diffstat (limited to 'clui.cpp')
-rw-r--r--clui.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clui.cpp b/clui.cpp
index 5eff6b2..520a758 100644
--- a/clui.cpp
+++ b/clui.cpp
@@ -113,8 +113,10 @@ void startGame()
delete game_field;
game_field = new GameField(gb_y, gb_x, gb_lwin);
drawGame(gb_y, gb_x);
- if(play_with_ai && gb_symbol == SYMBOL_PLAYERTWO)
+ if(play_with_ai && gb_symbol == SYMBOL_PLAYERTWO) {
+ game_bot->FirstMove(true);
aiMove();
+ }
}
void changePlayer()