Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 1.32 KB

README.md

File metadata and controls

59 lines (45 loc) · 1.32 KB

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