Newer
Older
"""
Dogopher: A Gopher and Dodo AI (IA02 P24 Project)
"""
from api import *
from hexgrid.grid import HexGrid
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def initialize(
game: str, state: State, player: Player, hex_size: int, total_time: Time
) -> Environment:
"""
Initialize the game environment.
Args:
game: The name of the game.
state: The initial state of the game.
player: The player number.
hex_size: The size of the hexagons.
total_time: The total time for the game.
Returns:
The game environment.
API from: https://gitlab.utc.fr/ia02/gopher-and-dodo
"""
pass
def strategy(
env: Environment, state: State, player: Player, time_left: Time
) -> tuple[Environment, Action]:
"""
The strategy of the player. Launched every time it's the turn of our AI to play.
Args:
env: The game environment.
state: The current state of the game.
player: The player number.
time_left: The time left for the player.
Returns:
The updated game environment and the action to play.
API from: https://gitlab.utc.fr/ia02/gopher-and-dodo
"""
pass
a: HexGrid = HexGrid.random_state(4)
grid = HexGrid(a.get_state(), a.size[0])