An open API service indexing awesome lists of open source software.

https://github.com/anwaralameddin/2pg

A testbed for two-player game agents
https://github.com/anwaralameddin/2pg

board-games strategy testbed two-player-game

Last synced: 11 months ago
JSON representation

A testbed for two-player game agents

Awesome Lists containing this project

README

          

# Two-Player Game (2PG)

[![CI](https://github.com/anwaralameddin/2pg/actions/workflows/ci.yml/badge.svg)](https://github.com/anwaralameddin/2pg/actions/workflows/ci.yml)

A testbed for two-player game agents. It's currently under development and
is limited to three games: Connect Four, Othello, and Tic Tac Toe.

## Usage

In a Python 3.11 environment, install the requirements
```
pip install -r requirements.txt
```
and run the package
```
python -m two_player_games -m -v -a1 [-d1 ] -a2 [-d2 ]
```
### Supported Games

- [Connect Four](https://en.wikipedia.org/wiki/Connect_Four) (connect4)
- [Othello](https://en.wikipedia.org/wiki/Reversi#Othello) (othello)
- [Tic Tac Toe](https://en.wikipedia.org/wiki/Tic-tac-toe) (tictactoe)

### Supported Views

- Hidden (hidden)
- [Pygame](https://www.pygame.org/news) (pygame)

### Supported Agents

- [X] Human (human)
- [X] Random (random)
- [ ] [Maximin](https://en.wikipedia.org/wiki/Minimax)
- [X] Naive: (maximin-naive)
- [X] Defensive: (maximin-defensive)
- [X] Stochastic: (maximin-stochastic)
- [X] [Alpha-Beta Pruning](https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning): (maximin-alpha-beta)
- [ ] [Negamax](https://en.wikipedia.org/wiki/Negamax)
- [ ] [Monte Carlo Tree Search (MCTS)](https://en.wikipedia.org/wiki/Monte_Carlo_tree_search)

### Example

```
python -m two_player_games -m tictactoe -v pygame -a1 human -a2 maximin-naive -d2 6
```