[iagno] Fix AI on non standard boards.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno] Fix AI on non standard boards.
- Date: Sat, 30 Mar 2019 10:14:37 +0000 (UTC)
commit 484dbaebe149caa2584a97e6fc32a585a0712f57
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Mar 29 14:20:55 2019 +0100
Fix AI on non standard boards.
src/computer-player.vala | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/src/computer-player.vala b/src/computer-player.vala
index a0dfead..760be13 100644
--- a/src/computer-player.vala
+++ b/src/computer-player.vala
@@ -325,7 +325,7 @@ private class ComputerPlayer : Object
return -tile_difference;
/* End of the game: just maximize the number of tokens */
- if (g.n_tiles >= 54)
+ if (g.n_tiles >= (g.size * g.size) - 10)
return tile_difference;
/* Normal strategy: try to evaluate the position */
@@ -338,7 +338,6 @@ private class ComputerPlayer : Object
return 0;
int count = 0;
-
for (uint8 x = 0; x < g.size; x++)
{
for (uint8 y = 0; y < g.size; y++)
@@ -349,7 +348,6 @@ private class ComputerPlayer : Object
count += h;
}
}
-
return count;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]