Skip to content

Puissance 4 (In french) is a graphical implementation of the classic Connect 4 game using the Qt framework

Notifications You must be signed in to change notification settings

SeiyaGame/puissanceQuatre

Repository files navigation

Puissance 4

Made with Guetom
This is a reupload of the project I did at school

puissanceQuatre

Introduction

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.

Features

  • 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.

Prerequisites

  • Qt 5.x or higher
  • C++11 or higher

Project Structure

  • puissancequatre.h and puissancequatre.cpp: Main game logic and UI setup.
  • ui_puissancequatre.h: UI definitions generated by Qt Designer.
  • lunchpuissancequatre.h and lunchpuissancequatre.cpp: Launcher class for starting the game.
  • qpushbuttoncustom.h and qpushbuttoncustom.cpp: Custom QPushButton class for handling button clicks.

How to Build and Run

1. Clone the repository

git clone https://github.com/yourusername/puissancequatre.git
cd puissancequatre

2. Open the project in Qt Creator

  • Open Qt Creator
  • Go to File -> Open File or Project...
  • Select the puissancequatre.pro file

3. Build the project

Click on the Build button or press Ctrl+B.

4. Run the project

Click on the Run button or press Ctrl+R.

Game Instructions

1. Start the game

Click on the Play button in the launcher.

2. Make a move

Click on one of the buttons at the top of the grid to drop your piece in the corresponding column.

3. Bot move

The bot will automatically make a move after the player.

Win the game

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

About

Puissance 4 (In french) is a graphical implementation of the classic Connect 4 game using the Qt framework

Resources

Stars

Watchers

Forks

Packages

No packages published