- validCards = []
- #filter list for cards that don't take you off map
- for card in cards:
- moveTo = utilities.cardDestination(gMap, you.robot.location, moveCards)
- if isValidSquare(moveTo, gMap, you.robot.location[0], you.robot.location[1]):
- validCards.add(card)
- def isValidSquare(self, gMap, x, y):
- w = gMap.width
- h = gMap.height
- if 0 <= x and x < w and 0 <= y and y < h:
- return True
- return False