Skip to content

floriannch/TicTacToe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

The classic two-player strategy game, with an optional AI opponent.

Gameplay Showcase

 === Tic Tac Toe ===

 X | 2 | 3
---|---|---
 4 | O | 6
---|---|---
 7 | 8 | X

Player X, choose a cell

About The Game

This is a console game built in C#. Two players take turns placing their mark (X or O) on a 3x3 grid. The first player to align three marks in a row, column, or diagonal wins the game. If all cells are filled with no winner, the game ends in a draw.

Features

  • Two Game Modes: Play against a friend locally, or challenge the AI
  • AI Opponent: The AI randomly selects from available cells each turn
  • Input Validation: Handles non-numeric input, out-of-range numbers, and already taken cells
  • Play Again: Replay without restarting the program
  • Clean Console UI: The board refreshes each turn for a smooth experience

Tech Stack

  • C#: Core programming language for all game logic
  • Visual Studio / .NET : Used for development and execution

Installation / How to Play

You will need the .NET SDK (version 6.0 or higher) installed on your system.

  1. Clone the repository
  2. Navigate to the project directory:
  3. Run the .cs file:

Once launched, you will be asked whether you want to play against the AI. The grid is numbered 1 to 9 as follows:

 1 | 2 | 3
---|---|---
 4 | 5 | 6
---|---|---
 7 | 8 | 9

Enter the number of the cell you want to play each turn.

Possible Improvements

  • Smarter AI that actually tries to block the player from winning
  • Score tracker across multiple games
  • Graphical interface

Acknowledgements

  • Built from scratch as a learning project in C#

About

A little C# learning project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages