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

https://github.com/thomaslemontagner/connect4game_rl

A Connect4 game with Reinforcement Learning
https://github.com/thomaslemontagner/connect4game_rl

game minimax-algorithm reinforcement-learning

Last synced: 9 days ago
JSON representation

A Connect4 game with Reinforcement Learning

Awesome Lists containing this project

README

        

# Connect4Game with Reinforcement Learning

Connect Four is a two-player strategy game in which players take turns dropping colored discs from the top into a grid. The goal is to get four of your discs in a row (horizontally, vertically, or diagonally) before your opponent does.


![image](https://user-images.githubusercontent.com/56484383/210179364-32c988d8-b767-4574-a203-31294c142025.png)

*source image: https://www.101computing.net/connect4-challenge/*

This `README.md` file provides a brief description of the Connect4 game, as well as instructions for installing the required packages, running the game from the command line, playing against an AI opponent, and starting the web API.

## Requirements

- Python 3.6 or later

## Installation

To install the required packages, run:

```bash
pip install -r requirements.txt
```
## Usage

To start a game run game.py
```
python game.py
```
You will be able to choose different modes:

* '0' for computer against computer
* '1' for 1 human player against computer
* '2' for 2 humans against each other


Then the board is displayed in the terminal.

## Computer Agents
### Minimax
A computer agent using the minimax algorithm to choose the best action.

### Q-learning
A computer agent using q-learning apporach to choose the best action.