Skip to content

An implementation of Minimax, Alpha-Beta and Monte-Carlo Tree Search to play Connect 4

License

Notifications You must be signed in to change notification settings

Xeon0X/Connect4AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connect4AI

An implementation of Minimax, Alpha-Beta and Monte Carlo Tree Search to play Connect 4

Requirement

You can install all the libraries needed using pip:

pip install -r requirements.txt

Usage

To play the game, run the src/graphics.py file.

You can choose to play against another human or against one of the AI.

python -m src.graphics

Project Structure

Here is the layout of this project:

Connect4AI
│
├── src
│   ├── AIs
│   │   ├── alphaBeta.py
│   │   ├── mcts.py
│   │   ├── Q_learning.py
│   │   └── minmax.py
│   │
│   ├── Statistics
│   │   ├── backup.py
│   │   ├── scoring_selection.py
│   │   ├── statistics.py
│   │   └── statistics_alphabeta.py
│   │
│   ├── score.py
│   ├── Game.py
│   ├── Player.py
│   └── graphics.py
│
└── tests
    └── test_score_calculation.py

Q Learning

To train the Q Learning IA with 1 000 000 games, run the src/AIs/Q_learning.py file.

python -m src.AIs.Q_learning

Testing

To run the tests for Connect4AI, navigate to the project directory and run the following commands:

python -m tests.test_score_calculation

License

This project is licensed under the terms of the GPL-3.0 license.

About

An implementation of Minimax, Alpha-Beta and Monte-Carlo Tree Search to play Connect 4

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •