-
Notifications
You must be signed in to change notification settings - Fork 1
/
abstract.py
executable file
·33 lines (26 loc) · 1.17 KB
/
abstract.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Abstract classes. Your classes must inherit from these.
"""
class AbstractPlayer:
"""Your player must inherit from this class, and your player class name must be 'Player', as in the given examples.
Like this: 'class Player(abstract.AbstractPlayer):'
"""
def __init__(self, setup_time, player_color, time_per_k_turns, k):
"""Player initialization.
:param setup_time: Allowed setup time in seconds, float.
:param player_color: A String representing this player's color.
:param time_per_k_turns: Allowed move calculation time per k turns.
:param k: The k above.
"""
self.setup_time = setup_time
self.color = player_color
self.time_per_k_turns = time_per_k_turns
self.k = k
def get_move(self, game_state, possible_moves):
"""Chooses an action from the given actions.
:param game_state: The current board state. It's always an amazons_board.amazonsBoard object.
:param possible_moves: A list of possible moves.
:return: The desired move in the list of possible moves.
"""
raise NotImplementedError
def __repr__(self):
return self.color