Skip to main content

Helper classes for ttt arena users

Project description

Tic-Tac-Toe Arena Helpers

This package includes helper classes for Tic Tac Toe Arena, the COMP3900 project for W18B - TheBigMacs.

These helpers allow the user to easily parse the input and create the output as required by our API. This is in the form of two straight-forward dataclasses: AgentMove, and GameState.

GameState defines the information the agent has available with which to make a decision. It has the attributes:

  • rows
  • cols
  • k
  • current_move
  • grid

AgentMove helps the agent declare the position it wishes to make a move in. It simply has the attributes row and col.

In order to create an agent that fits our API, the user simply needs to implement a function such that it takes in an input GameState and returns an AgentMove, such as the following.

from comp3900_ttt_arena_helpers import AgentMove, GameState

def make_move(game_state: GameState) -> AgentMove:
    """
    Dummy agent that looks for the first empty cell it can find and makes a move there
    """

    for row in range(game_state.rows):
        for col in range(game_state.cols):
            if game_state.grid[row][col] == "":
                return AgentMove(row, col)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

comp3900_ttt_arena_helpers-0.0.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page