Skip to content

TylerFortune/Connect-4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Connect-4 Game

A Command-Line Connect-4 Game in Python with AI Opponent

This project is a Python-programmed simulation of the classic board game Connect-4. It allows a single player to challenge a computer opponent with a hard-coded AI directly in the terminal. The game aims to provide an interactive experience for playing Connect-4 against an automated player.

Features

  • Single-Player Mode: Play against a computer AI opponent.
  • Hard-Coded AI: The computer opponent makes strategic moves based on its programmed logic.
  • Interactive Gameplay: Place your tokens on the Connect-4 grid directly from your command line interface.
  • Game Board Display: Visual representation of the Connect-4 board in the terminal.
  • Win Condition Detection: The game logic determines when a player or the AI has achieved four in a row, declaring a winner.

File Structure

  • Connect-4.py: This is the main Python script that contains all the game logic, including the board representation, player input handling, AI decision-making, move validation, and win condition checks.
  • README.md: This file provides an overview of the project, its features, and instructions on how to set it up and play.

How to Get Started

To run the Connect-4 game on your local machine, follow these simple steps:

  1. Clone the repository: Open your terminal or command prompt and run:
    git clone https://github.com/TylerFortune/Connect-4
  2. Navigate to the project directory:
    cd Connect-4
  3. Run the game: Make sure you have Python (version 3.x is recommended) installed, then execute the main script:
    python Connect-4.py
    The game will launch in your terminal, and you can follow the on-screen prompts to play against the AI.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages