Skip to content

Sintsun/Connect-4-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

Connect 4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages