Skip to content

sahifasyed/Tic-Tac-Toe-in-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Assignment 2023/2024

Introduction

Welcome to the 3x3 Grid Game, a console-based C++ project developed as part of my Programming in C++ module during my first year of study. This engaging two-player game recreates the classic 3x3 grid gameplay, where players take turns making strategic moves until one player wins or the game ends in a draw.

Module Grade: 79/100

Gameplay Overview

  • Player 1's Turn:

    • Prompted to enter two numbers representing their move coordinates.
    • Input is validated to ensure it falls within the acceptable range.
  • Player 2's Turn:

    • Similarly prompted for their move coordinates with the same validations.
  • Game Loop:

    • The game continues alternating turns until a winning condition is met or the grid is full resulting in a draw.

How It Works

Move Process

  1. Enter Move:
    Players input their chosen grid coordinates during their respective turns.

  2. Range Validation:
    The program checks whether the entered coordinates are valid and within the 3x3 grid boundaries.

  3. Play Piece:
    The program confirms the chosen spot is unoccupied before placing the player's piece.

  4. Board Display:
    After each move, the updated game board is displayed in the console.

  5. Winning Condition Check:
    Following every move, the program evaluates if the current player has achieved three in a row, column, or diagonal.

    • If a winning condition is met, a victory message is shown.
  6. Draw Condition Check:
    If the grid is filled without any player winning, the game ends in a draw and an appropriate message is displayed.

About

3x3 Grid Game: A C++ console-based two-player game for my 2023/2024 Programming in C++ module. Players alternate moves on a 3x3 grid, with input validation, board updates, and win/draw checks. Grade: 79/100

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages