puzzle_defaults = deck.get('defaults', {})
for k, v in puzzle_defaults.iteritems():
if isinstance(v, list):
puzzle_defaults = deck.get('defaults', {})
for k, v in puzzle_defaults.iteritems():
if isinstance(v, list):
player = Player(initial_bits, initial_pos)
board_locations = cls.import_board_locations(
cls.generate_board(deck))
player = Player(initial_bits, initial_pos)
board_locations = cls.import_board_locations(
cls.generate_board(deck))
- return cls(state, player, board_locations)
+ board = cls(state, player, board_locations)
+ player.set_gameboard(board)
+ return board
'clock_count': self.clock_count,
'replacement_params': self.replacement_params,
}
'clock_count': self.clock_count,
'replacement_params': self.replacement_params,
}
if ROTATION[direction] == ROTATION.CLOCKWISE:
new_positions = locations_to_rotate[1:] + [locations_to_rotate[0]]
elif ROTATION[direction] == ROTATION.ANTICLOCKWISE:
if ROTATION[direction] == ROTATION.CLOCKWISE:
new_positions = locations_to_rotate[1:] + [locations_to_rotate[0]]
elif ROTATION[direction] == ROTATION.ANTICLOCKWISE:
for old, new in zip(locations_to_rotate, new_positions):
rotated_locations[new] = self.board_locations[old]
for old, new in zip(locations_to_rotate, new_positions):
rotated_locations[new] = self.board_locations[old]
"""
def __init__(self, card_name, bitwise_operand, location_actions,
"""
def __init__(self, card_name, bitwise_operand, location_actions,
self.card_name = card_name
self.bitwise_operand = bitwise_operand
self.actions = location_actions
self.max_number = max_number
self.card_name = card_name
self.bitwise_operand = bitwise_operand
self.actions = location_actions
self.max_number = max_number
- def new_location(cls, definition, replacement_params):
+ def new_location(cls, definition, replacement_params=None, puzzle=False):
max_number = definition.get('max_number', 25)
card_name = definition['card_name']
max_number = definition.get('max_number', 25)
card_name = definition['card_name']
'bitwise_operand': bits,
'actions': definition['actions'],
'max_number': max_number,
'card_name': card_name,
'replacement_time': replacement_time,
})
'bitwise_operand': bits,
'actions': definition['actions'],
'max_number': max_number,
'card_name': card_name,
'replacement_time': replacement_time,
})
self.replacement_time -= 1
if self.replacement_time <= 0:
board.replace_card(position)
self.replacement_time -= 1
if self.replacement_time <= 0:
board.replace_card(position)