Skip to main content

Mancala

PyPI - Downloads

Mancala board game written in python.

img

Features & Road maps

  • Mancala playable on CLI
  • Cmpatible with the gym API
  • Can train RL agents
  • Mancala playable on GUI

Installation

$ pip install mancala

Usage

Play a game with agents

$ 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

$ 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.

Value Iteration

Using Dynamic Programming (DP), calculate value for states and memorize them. Use the value to plan future actions.

Other implementations

Policy Iteration

Using Dynamic Programming (DP), calculate value for states and memorize them. Use the value and policy for planning.

References

Multi agent RL

Release files for mancala 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mancala 0.3.0
File Size Uploaded
mancala-0.3.0.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mancala 0.3.0
File Interpreter ABI Platform
mancala-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.5 kB

Release files / mancala-0.3.0.tar.gz

Download URL mancala-0.3.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
94981791d24cd7178d05ec48ad79ff1be353bda3f983527453f37d6f06252ae6
BLAKE2b-256 checksum
How to use checksums
89e82c982474497cead1129c39e34177c179007b7adb9bb63601587c3ca49aab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.8 Darwin/20.4.0

Release files / mancala-0.3.0-py3-none-any.whl

Download URL mancala-0.3.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e03595eb3ed68980e8efd8dd9c6f3bab8363f4889a2d7ee975204d3260f8bf6
BLAKE2b-256 checksum
How to use checksums
c3ff85b6cd81fbbb77bb9bae69fda776ac50d0da5898e4584d0464edc768bbda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.8 Darwin/20.4.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page