Fully functional Connect4 game with AI opponent written in C++ and SFML.
- Click on a column to place your piece.
- Play against AI.
- The AI uses a simple strategy to block or win when possible.
Hidden feature
Pressing R resets the board.
Pressing U undoes the last move. Useful when experimenting with AI strategies or testing.
This project is built with Visual Studio on Windows.
- Install dependencies:
- Visual Studio with C++ Desktop Development workload.
- SFML library.
- Open the project:
- Open
Connect4.slnin Visual Studio.
- Set up SFML:
- Make sure
SFML_library/includeis in Project > Properties > C/C++ > General > Additional Include Directories. - Make sure
SFML_library/libis in Project > Properties > Linker > General > Additional Library Directories. - Link required SFML libraries in Linker > Input > Additional Dependencies.
- Build and run:
- Choose the
DebugorReleaseconfiguration. - Press F5 or Run to start the game.