Skip to content

a-pagano/tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3-dimensional tic-tac-toe with variable grid size

Pre-requisites

  • Python 3.10
  • Poetry 1.2.2

Install

poetry install

Run

poetry run tictactoe/tictactoe.py --help
Usage: tictactoe.py [OPTIONS]

Options:
  --size TEXT        Size of the grid
  --plot             Whether to plot the board in 3D
  --help             Show this message and exit.

Example

# 4x4x4 cube with plotting
$ poetry run tictactoe/tictactoe.py --size 4 --plot
Player 1, pick your next move in the range (0,0,0) to (3,3,3) or type 'exit' to quit the game
>>> (0,0,0)
Player 2, pick your next move in the range (0,0,0) to (3,3,3) or type 'exit' to quit the game
>>> (2,0,1)
Player 1, pick your next move in the range (0,0,0) to (3,3,3) or type 'exit' to quit the game
>>> (1,1,1)
Player 2, pick your next move in the range (0,0,0) to (3,3,3) or type 'exit' to quit the game
>>> (1,2,2)
Player 1, pick your next move in the range (0,0,0) to (3,3,3) or type 'exit' to quit the game
>>> (2,2,2)
Player 2, pick your next move in the range (0,0,0) to (3,3,3) or type 'exit' to quit the game
>>> (2,0,0)
Player 1, pick your next move in the range (0,0,0) to (3,3,3) or type 'exit' to quit the game
>>> (3,3,3)
Player 1 has won! Congrats!

plot

Test

poetry install
poetry run pytest

About

3D tic-tac-toe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages