Giter VIP home page Giter VIP logo

terminal's Introduction

Starter Algo

File Overview

starter-algo
 │
 ├──gamelib
 │   ├──__init__.py
 │   ├──advanced_game_state.py
 │   ├──algocore.py
 │   ├──game_map.py
 │   ├──game_state.py
 │   ├──navigation.py
 │   ├──tests.py
 │   ├──unit.py
 │   └──util.py
 │ 
 ├──algo_strategy.py
 ├──README.md
 ├──run.ps1
 └──run.sh

Creating an Algo

To create an algo, simply modify the algo_strategy.py file.

algo_strategy.py

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 inital setup there.

run.sh

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.

run.ps1

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.

gamelib/__init__.py

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.

gamelib/advanced_game_state.py

This module contains the AdvancedGameState class. This file is a version of gamestate with access to a few more advanced functions.

gamelib/algocore.py

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.

gamelib/game_map.py

This module contains the GameMap class which is used to parse the game state and provide functions for querying it.

gamelib/navigation.py

Functions and classes used to implement pathfinding.

gamelib/tests.py

Unit tests. You can write your own if you would like, and can run them using the following command:

python3 -m unittest discover

gamelib/unit.py

This module contains the GameUnit class which holds information about a Unit.

gamelib/util.py

Helper functions and values that do not yet have a better place to live.

Strategy Overview

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 destructors in its corners, and randomly spawn encryptors and units.

terminal's People

Contributors

eeveeking avatar

Watchers

 avatar

Forkers

kongfanzhong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.