Skip to content
Snippets Groups Projects
dogopher.py 1.28 KiB
Newer Older
Gabriel Santamaria's avatar
Gabriel Santamaria committed
"""
Dogopher: A Gopher and Dodo AI (IA02 P24 Project)
"""

from api import *
from hexgrid.grid import HexGrid
Gabriel Santamaria's avatar
Gabriel Santamaria committed
from game.rules import Gopher
Gabriel Santamaria's avatar
Gabriel Santamaria committed


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)
Gabriel Santamaria's avatar
Gabriel Santamaria committed

print(a.is_empty())

print(str(a))
Gabriel Santamaria's avatar
Gabriel Santamaria committed

grid = HexGrid(a.get_state(), a.size[0])

grid.debug_plot()