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
Built Distribution
File details
Details for the file comp3900_ttt_arena_helpers-0.0.4.tar.gz
.
File metadata
- Download URL: comp3900_ttt_arena_helpers-0.0.4.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fecc158215314ad972d8b349b3f67ab089fcbc2bf180b58cfe84fac597a004b |
|
MD5 | 6314e5cc604c2f478efaed0217609a2c |
|
BLAKE2b-256 | d921275e6dacce74026032f7ac7d7e3e5a58e91ce1069db2d239caddda210a95 |
File details
Details for the file comp3900_ttt_arena_helpers-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: comp3900_ttt_arena_helpers-0.0.4-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca044a6785ab95b5ae88435065baf2c2e23684271fce7ae4077b5c50762b56ee |
|
MD5 | 5581f1078c6e2cf1fa0ce1e2e5087d04 |
|
BLAKE2b-256 | a957c6d7f6e8ff98daf597f0692e25d434081a2d8a1823910f2b3f4f676c42ab |