Skip to content

Latest commit

 

History

History
44 lines (26 loc) · 1.47 KB

File metadata and controls

44 lines (26 loc) · 1.47 KB

Connect Four Game

This project implements the classic Connect Four game with a graphical user interface. image

Overview

Connect Four is a two-player connection game in which players first choose a color and then take turns dropping colored discs into a seven-column, six-row vertically suspended grid. The pieces fall straight down, occupying the lowest available space within the column. The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs.

Project Structure

  • ConnectFour.java: Interface defining the core game logic.
  • ConnectFourGui.java: GUI for the Connect Four game using Java Swing.

How to Run

  1. Clone the repository.
  2. Ensure you have Java installed on your system.
  3. Compile the Java files.
  4. Run the ConnectFourGui class to start the game.

Features

  • Graphical user interface to play Connect Four.
  • Players can drop tokens by clicking buttons corresponding to each column.
  • Displays the current player's turn and announces the winner.
  • Option to restart the game.

Requirements

  • Java Development Kit (JDK) 8 or higher.

Usage

  • Click on the column buttons to drop your token.
  • The game will automatically switch turns between players.
  • The game ends when a player connects four tokens in a row, either horizontally, vertically, or diagonally.

Author

  • Developed for the Assignment.