[iagno] Disallow some initial moves.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno] Disallow some initial moves.
- Date: Tue, 4 Jun 2019 13:34:47 +0000 (UTC)
commit fa2d412e4abf91fc9872132ad044e030878367b2
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Tue Jun 4 15:07:33 2019 +0200
Disallow some initial moves.
src/computer-reversi.vala | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/computer-reversi.vala b/src/computer-reversi.vala
index fd54575..ad4e1ea 100644
--- a/src/computer-reversi.vala
+++ b/src/computer-reversi.vala
@@ -309,7 +309,17 @@ private abstract class ComputerReversi : ComputerPlayer
/* For the first/first two moves play randomly so the game is not always the same */
if (g.n_tiles < move_randomly)
{
- random_select (g, out best_move);
+ if (size != 8)
+ random_select (g, out best_move);
+ else
+ {
+ do
+ {
+ random_select (g, out best_move);
+ }
+ while ((best_move.x == 1 || best_move.x == 6)
+ && (best_move.y == 1 || best_move.y == 6));
+ }
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]