2to3
This commit is contained in:
parent
69618c2a1f
commit
68b2d193c8
|
@ -28,8 +28,8 @@ class State():
|
||||||
def getPossibleMoves(self):
|
def getPossibleMoves(self):
|
||||||
moves = []
|
moves = []
|
||||||
|
|
||||||
for x in xrange(0, 5):
|
for x in range(0, 5):
|
||||||
for y in xrange(0, 5):
|
for y in range(0, 5):
|
||||||
|
|
||||||
if (self.isLegalMoveLocation(x, y)):
|
if (self.isLegalMoveLocation(x, y)):
|
||||||
moves.append((x, y))
|
moves.append((x, y))
|
||||||
|
@ -116,7 +116,7 @@ class GameNode(object):
|
||||||
state = self.state
|
state = self.state
|
||||||
|
|
||||||
while not state.gameOver:
|
while not state.gameOver:
|
||||||
moves = state.getPossibleMoves
|
moves = state.getPossibleMoves()
|
||||||
randomMove = random.choice(possibleMoves)
|
randomMove = random.choice(possibleMoves)
|
||||||
state.playMove(randomMove)
|
state.playMove(randomMove)
|
||||||
|
|
||||||
|
@ -173,6 +173,6 @@ initial_state = game.State.read_packed(f)
|
||||||
|
|
||||||
# print(initial_state)
|
# print(initial_state)
|
||||||
s = State(initial_state)
|
s = State(initial_state)
|
||||||
print(s.getPossibleMoves())
|
print((s.getPossibleMoves()))
|
||||||
|
|
||||||
# 3,2
|
# 3,2
|
||||||
|
|
|
@ -12,8 +12,8 @@ state = game.State.new_message()
|
||||||
houses = ["empty", "varys", "tully", "tyrell", "baratheon", "targaryen", "lannister", "greyjoy", "stark"]
|
houses = ["empty", "varys", "tully", "tyrell", "baratheon", "targaryen", "lannister", "greyjoy", "stark"]
|
||||||
cards = []
|
cards = []
|
||||||
|
|
||||||
for x in xrange(1, 9):
|
for x in range(1, 9):
|
||||||
for y in xrange(0, x):
|
for y in range(0, x):
|
||||||
card = game.Card.new_message()
|
card = game.Card.new_message()
|
||||||
card.house = houses[x]
|
card.house = houses[x]
|
||||||
cards.append(card)
|
cards.append(card)
|
||||||
|
|
Loading…
Reference in New Issue