Skip to content

๐Ÿค– A simple and extensible Connect4 with graphical user interface where you can play against an AI.

License

Notifications You must be signed in to change notification settings

marcpinet/connect4-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Connect4 AI

๐Ÿ“ Description

A simple Connect4 made with C++ and SFML for the window. Currently, only the Minimax with Alpha Beta Pruning is implemented. Maybe, in the future, I'll implement other algorithms if I want to (such as MCTS?).

๐ŸŽฅ Demo Minimax with Alpha Beta Pruning

Connect4_AI_6cDWwN6NnG.mp4

๐Ÿ’ก How to use

๐ŸชŸ Windows

If you've a C/C++ IDE, you should already have cmake and gcc/g++. If not, then install CMake here and gcc/g++ here.

  1. Clone the repository
git clone https://github.com/marcpinet/connect4-ai
  1. Initialize the SFML submodule
git submodule update --init --recursive
  1. Build with CMake
cmake -S . -B output -DCMAKE_BUILD_TYPE=Release -G"MinGW Makefiles"
  1. Build the project using make inside the newly created output folder
cd output && make
  1. Run the .exe

๐Ÿง Linux / WSL

  1. Run the holy command
sudo apt-get update
  1. Install the following packages
sudo apt install libsfml-dev gdb cmake build-essential libvorbis-dev libopenal-dev freetype2-demos libudev-dev libx11-dev libxrandr-dev
  1. Clone the repository
git clone https://github.com/marcpinet/connect4-ai
  1. Initialize the SFML submodule
git submodule update --init --recursive
  1. Build with CMake
cmake -S . -B output -DCMAKE_BUILD_TYPE=Release
  1. Build the project using make inside the newly created output folder
cd output && cp -r ../assets assets && make
  1. Run the file!
chmod u+x Connect4_AI && ./Connect4_AI

๐Ÿ“„ Note

On Windows, it will probably be easier to run the project using an IDE such as CLion.

No cache issue.

About

๐Ÿค– A simple and extensible Connect4 with graphical user interface where you can play against an AI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published