Skip to content

Play Tic Tac Toe with a twist: achieve a sum of 15 across rows, columns, or diagonals to win! This Python game features interactive gameplay where X and O compete to reach the magic number first.

Notifications You must be signed in to change notification settings

VIKRAM2563/TicTacToe-MagicNumber-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Tic Tac Toe with Magic Number

Overview

This project implements a Tic Tac Toe game in Python, where players use a 3x3 grid to place their marks (X or O). The game determines the winner based on achieving a specific "magic number" sum of 15 across rows, columns, or diagonals.

Magic Number Concept

In this game:

  • X is represented by 1.
  • O is represented by -1.
  • The magic number for win condition is 15.

When a player achieves a sum of 15 (or -15 for the opponent) across any row, column, or diagonal, they win the game.

Features

  • Interactive console-based gameplay.
  • Magic number determines win conditions.
  • Clear instructions guide players through the game.

Gameplay

  • Players alternate turns entering their moves.
  • Enter row and column coordinates (e.g., "1,2" for the first row, second column).
  • The first player to achieve the magic number sum of 15 in any row, column, or diagonal wins.
  • The game ends in a draw if the board fills up without achieving the magic number.

Credits

  • This Tic Tac Toe game was created by Vikram P.
  • Inspired by the concept of using magic numbers in game development.

About

Play Tic Tac Toe with a twist: achieve a sum of 15 across rows, columns, or diagonals to win! This Python game features interactive gameplay where X and O compete to reach the magic number first.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages