https://github.com/qqpann/mancala
Mancala board game, written in python. The rule is Kalah and can be extended.
https://github.com/qqpann/mancala
game gym gym-environment kalah mancala mancala-game pytorch reinforcement-learning
Last synced: 6 months ago
JSON representation
Mancala board game, written in python. The rule is Kalah and can be extended.
- Host: GitHub
- URL: https://github.com/qqpann/mancala
- Owner: qqpann
- Created: 2021-02-02T09:13:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-23T16:32:24.000Z (over 3 years ago)
- Last Synced: 2024-11-09T22:48:08.503Z (7 months ago)
- Topics: game, gym, gym-environment, kalah, mancala, mancala-game, pytorch, reinforcement-learning
- Language: Python
- Homepage:
- Size: 21 MB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mancala

Mancala board game written in python.

## Features & Road maps
- [x] Mancala playable on CLI
- [x] Cmpatible with the gym API
- [ ] Can train RL agents
- [ ] Mancala playable on GUI## Installation
```shell
$ pip install mancala
```## Usage
### Play a game with agents
```shell
$ mancala play --player0 human --player1 random
```### Compare each agents and plot their win rates
The values are player1's (second move) win rates in percentage
```shell
$ mancala arena
p0_random p0_exact p0_max p0_minimax p0_negascout
p1_random 50.0 53.0 3.0 0.0 0.0
p1_exact 42.0 48.0 4.0 1.0 1.0
p1_max 95.0 91.0 41.0 0.0 3.0
p1_minimax 100.0 96.0 87.0 30.0 39.0
p1_negascout 100.0 97.0 84.0 19.0 32.0
```## Algorithms
Mancala is a game with perfect information.
マンカラは完全情報ゲームです。### Mini-Max
Mini-max is an algorithm for n-player zero-sum games.
The concept is to assume the opponent will take their best move and try to minimize them.- MiniMax
- Alpha-beta pruning
- Negamax
- NegaScout (PVS, principal variation search)### Value Iteration
Using Dynamic Programming (DP), calculate value for states and memorize them.
Use the value to plan future actions.Other implementations
- OpenSpiel value_iteration
algorithm
example### Policy Iteration
Using Dynamic Programming (DP), calculate value for states and memorize them.
Use the value and policy for planning.## References
-
### Multi agent RL
-
-