summaryrefslogtreecommitdiffstats
path: root/ai.hpp
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-02-19 19:00:50 +0000
committerJoursoir <chat@joursoir.net>2021-02-19 19:00:50 +0000
commit42a235befbb4fc644ec806576211999a27ef1c6e (patch)
tree774908df1c4966c86b88cfea3e67dd7ee189cd0f /ai.hpp
parent0f2504aaa684d53bb30a6d3c152e35f9dfe6e47e (diff)
downloadlp-gomoku-42a235befbb4fc644ec806576211999a27ef1c6e.tar.gz
lp-gomoku-42a235befbb4fc644ec806576211999a27ef1c6e.tar.bz2
lp-gomoku-42a235befbb4fc644ec806576211999a27ef1c6e.zip
add class artificial intelligence with functional
Diffstat (limited to 'ai.hpp')
-rw-r--r--ai.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/ai.hpp b/ai.hpp
new file mode 100644
index 0000000..19420e5
--- /dev/null
+++ b/ai.hpp
@@ -0,0 +1,19 @@
+#ifndef LPG_AI_H
+#define LPG_AI_H
+
+class GameField;
+
+class AI {
+ int max_depth;
+public:
+ AI(int d);
+
+ void GetFirstMove(int &my, int &mx, int rows, int cols);
+ void GetBestMove(int &my, int &mx, GameField field);
+private:
+ int score(GameField field);
+ int min(GameField field, int depth);
+ int max(GameField field, int depth);
+};
+
+#endif /* LPG_AI_H */