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
- Host: GitHub
- URL: https://github.com/thomaslemontagner/connect4game_rl
- Owner: ThomasLeMontagner
- Created: 2022-12-28T15:09:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-04T10:35:59.000Z (over 2 years ago)
- Last Synced: 2025-05-18T14:10:02.605Z (about 1 month ago)
- Topics: game, minimax-algorithm, reinforcement-learning
- Language: Python
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.

*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
```
## UsageTo 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.