Coder Social home page Coder Social logo

abhijeetkrishnan / fanorona-aec Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 644 KB

A PettingZoo AECEnv implementation of the board game Fanorona

Home Page: https://pypi.org/project/fanorona-aec/

License: MIT License

Python 100.00%
pettingzoo board-game-fanorona openai-gym-environment

fanorona-aec's Introduction

Fanorona AEC Environment

PyPI v3.0.2 License: MIT Ruff pre-commit

  A B C D E F G H I
5 ●─●─●─●─●─●─●─●─●
  │╲│╱│╲│╱│╲│╱│╲│╱│
4 ●─●─●─●─●─●─●─●─●
  │╱│╲│╱│╲│╱│╲│╱│╲│
3 ●─○─●─.─○─.─○─●─○
  │╲│╱│╲│╱│╲│╱│╲│╱│
2 ○─○─○─○─○─○─○─○─○
  │╱│╲│╱│╲│╱│╲│╱│╲│
1 ○─○─○─○─○─○─○─○─○

W to play
Last capture: E3 E
Visited: D3, E3
Half-moves: 0

This is an implementation of the Fanorona board game as a PettingZoo AEC game. The rules have been sourced from here. An additional rule where games exceeding $44$ moves end in a draw has been implemented, since the original rules do not have explicit draw conditions.

Installation

Using pip (recommended)

python -m pip install fanorona-aec

Local

git clone https://github.com/AbhijeetKrishnan/fanorona-aec.git
cd fanorona-aec
python -m pip install .

Usage

Setting up a basic environment

In a Python shell, run the following:

from fanorona_aec import fanorona_v3
env = fanorona_v3.env()

See demo.py for a script that implements a simple random policy to interact with the environment.

Testing

We use pytest for tests. You can run them via:

git clone https://github.com/AbhijeetKrishnan/fanorona-aec.git
cd fanorona-aec
python -m pip install .[dev]
pytest

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.