Posts

Showing posts with the label game

C++ project connect 4 game || source code

Image
Play the classic Connect 4 game in C++. It's a two-player game of strategy where you try to connect four pieces in a row. The game features a graphical console interface. You can win by connecting four pieces horizontally, vertically, or diagonally. The game also checks for ties. You'll use arrays, loops, and player interaction to build the game  Introduction: This C++ code creates a virtual representation of the Connect 4 game. It simulates a grid where two players drop colored disks. The goal is to connect four disks of the same color in a row, column, or diagonal before the other player does. #include<iostream> #include<windows.h> using namespace std; char conn_4[7][6]; int counter[7] = { 0 }; void print() {  system("color 06");  cout << "\t\t\t************************* CONNECT 4 GAME **************************\n\n\n";  for (int i = 5; i >= 0; i--) {   cout << endl << "\t\t\t\t\t |___|___|___|___|___|___|___|\n"