starter-algo
│
├──gamelib
│ ├──__init__.py
│ ├──algocore.py
│ ├──game_map.py
│ ├──game_state.py
│ ├──navigation.py
│ ├──tests.py
│ ├──unit.py
│ └──util.py
│
├──algo_strategy.py
├──documentation
├──README.md
├──run.ps1
└──run.sh
To create an algo, simply modify the algo_strategy.py
file.
To upload to terminal, upload the entire python-algo folder.
This file contains the AlgoStrategy
class which you should modify to implement
your strategy.
At a minimum you must implement the on_turn
method which handles responding to
the game state for each turn. Refer to the starter_strategy
method for inspiration.
If your algo requires initialization then you should also implement the
on_game_start
method and do any initial setup there.
A directory containing the sphinx generated programming documentation, as well as the files required to build it. You can view the docs by opening index.html in documents/_build. You can remake the documentation by running 'make html' in the documentation folder. You will need to install sphinx for this command to work.
A script that contains logic to invoke your code. You do not need to run this directly. See the 'scripts' folder in the Starterkit for information about testing locally.
A script that contains logic to invoke your code. You shouldn't need to change this unless you change file structure or require a more customized process startup.
This file tells python to treat gamelib
as a bundled python module. This
library of functions and classes is intended to simplify development by
handling tedious tasks such as communication with the game engine, summarizing
the latest turn, and estimating paths based on the latest board state.
This file contains code that handles the communication between your algo and the core game logic module. You shouldn't need to change this directly. Feel free to just overwrite the core methods that you would like to behave differently.
This module contains the GameMap
class which is used to parse the game state
and provide functions for querying it.
Functions and classes used to implement path-finding.
Unit tests. You can write your own if you would like, and can run them using the following command:
python3 -m unittest discover
This module contains the GameUnit
class which holds information about a Unit.
Helper functions and values that do not yet have a better place to live.
The starter strategy is designed to highlight a few common GameMap
functions
and give the user a functioning example to work with. It's gameplan is to
draw the C1 logo, place turrets in its corners, and randomly spawn units.