[iagno/wip/redesign] Computer: move quickly if only one spot remains
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno/wip/redesign] Computer: move quickly if only one spot remains
- Date: Tue, 5 Nov 2013 04:31:31 +0000 (UTC)
commit b2885f2b537be506aa92a49bedc38607910a2560
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Mon Nov 4 21:53:44 2013 -0600
Computer: move quickly if only one spot remains
When there's only one spot remaining on the board, it looks silly for
the computer to sit and wait to "think" about it.
src/iagno.vala | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/iagno.vala b/src/iagno.vala
index 74c65f8..a18ec32 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -348,7 +348,9 @@ public class Iagno : Gtk.Application
* higher difficulties. (In actuality, Hard will take longer anyway
* since it must search deeper, but this compensates somewhat.)
*/
- if (game.current_color == Player.LIGHT && light_computer != null)
+ if (game.n_tiles == 63)
+ computer_timer = Timeout.add_seconds (1, computer_move_cb);
+ else if (game.current_color == Player.LIGHT && light_computer != null)
computer_timer = Timeout.add_seconds (5 - light_computer.level, computer_move_cb);
else if (game.current_color == Player.DARK && dark_computer != null)
computer_timer = Timeout.add_seconds (5 - dark_computer.level, computer_move_cb);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]