Made with Guetom
This is a reupload of the project I did at school
Puissance 4 is a graphical implementation of the classic Connect 4 game using the Qt framework.
This project features a simple user interface where players can compete against a bot.
The game supports basic functionalities including grid initialization, player and bot moves, and win condition checking.
- Graphical grid display with dynamic QLabel elements.
- Interactive buttons for player moves.
- Bot that makes random moves.
- Win condition checks for rows, columns, and diagonals.
- End game messages for both player and bot victories.
- Qt 5.x or higher
- C++11 or higher
puissancequatre.h
andpuissancequatre.cpp
: Main game logic and UI setup.ui_puissancequatre.h
: UI definitions generated by Qt Designer.lunchpuissancequatre.h
andlunchpuissancequatre.cpp
: Launcher class for starting the game.qpushbuttoncustom.h
andqpushbuttoncustom.cpp
: Custom QPushButton class for handling button clicks.
git clone https://github.com/yourusername/puissancequatre.git
cd puissancequatre
- Open Qt Creator
- Go to File -> Open File or Project...
- Select the
puissancequatre.pro
file
Click on the Build button or press Ctrl+B.
Click on the Run button or press Ctrl+R.
Click on the Play button in the launcher.
Click on one of the buttons at the top of the grid to drop your piece in the corresponding column.
The bot will automatically make a move after the player.
The game checks for four consecutive pieces in a row, column, or diagonal. A message will display the winner and the game will disable further moves