[iagno] computer-player: add another assertion
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno] computer-player: add another assertion
- Date: Fri, 19 Sep 2014 14:20:33 +0000 (UTC)
commit 4c14d0cd4ec60dfab9ac8d116c7881960b3b9025
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Fri Sep 19 09:20:09 2014 -0500
computer-player: add another assertion
src/computer-player.vala | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/computer-player.vala b/src/computer-player.vala
index ea80e7e..10deff0 100644
--- a/src/computer-player.vala
+++ b/src/computer-player.vala
@@ -197,9 +197,14 @@ public class ComputerPlayer : Object
foreach (var move in moves)
{
if (move.n_tiles == 0)
+ {
g.pass ();
+ }
else if (g.place_tile (move.x, move.y) == 0)
+ {
critical ("Computer marked move (depth %d, %d,%d, %d flips) as valid, but is invalid when
checking", depth, move.x, move.y, move.n_tiles);
+ assert_not_reached ();
+ }
int next_x_move = 0, next_y_move = 0;
var a_new = -1 * search (g, strategy, depth - 1, -b, -a, ref next_x_move, ref next_y_move);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]