diff --git a/gothok/game.py b/gothok/game.py index c42ae1a..3e5dbc4 100644 --- a/gothok/game.py +++ b/gothok/game.py @@ -112,6 +112,16 @@ class GameNode(object): def runSimulation(self): self.backPropagate(self.simulate()) + def simulate(self): + state = self.state + + while not state.gameOver: + moves = state.getPossibleMoves + randomMove = random.choice(possibleMoves) + state.playMove(randomMove) + + return self.state.result(state) + def getChildren(self): possibleMoves = self.state.getPossibleMoves() children = []