From 2dfab68efe58a047919b16e7c89a83d3c7f13d7f Mon Sep 17 00:00:00 2001 From: rtz19970824 Date: Thu, 28 Dec 2017 19:28:21 +0800 Subject: [PATCH] debug for unit test --- AlphaGo/game.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AlphaGo/game.py b/AlphaGo/game.py index 82cf254..8329b1b 100644 --- a/AlphaGo/game.py +++ b/AlphaGo/game.py @@ -28,6 +28,8 @@ class Game: ''' def __init__(self, name=None, role=None, debug=False, checkpoint_path=None): self.name = name + if role is None: + raise ValueError("Need a role!") self.role = role self.debug = debug if self.name == "go": @@ -123,7 +125,7 @@ class Game: sys.stdout.flush() if __name__ == "__main__": - game = Game(name="reversi", checkpoint_path=None) + game = Game(name="reversi", role="black", checkpoint_path=None) game.debug = True game.think_play_move(utils.BLACK)