Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1.12 KB

File metadata and controls

29 lines (23 loc) · 1.12 KB

TicTacToe

Written TicTacToe on my nephew's demand so they can play this on their free time. This implementation allows us to play TicTacToe of any grid of size N×N in addition to standard 3X3

Game can be played in Single player mode against System or in 2 player mode.

Keep in mind that you will be playing against dumbest System ever when in Single player mode. 
System makes dumb decisions and even hangs while finding a appropriate position sometimes! :)

Board size can be changed passing different size to constructor of Board

Input is taken as horizontal,vertical cordinates format

e.g.:

    Enter input : 
    1,2             // <--- 1st row, 2nd column
    Board is 
    ┏━━━┳━━━┳━━━┳━━━┓
    ┃   ┃ O ┃   ┃   ┃
    ┣━━━╋━━━╋━━━╋━━━┫
    ┃   ┃   ┃   ┃   ┃
    ┣━━━╋━━━╋━━━╋━━━┫
    ┃   ┃   ┃   ┃   ┃
    ┣━━━╋━━━╋━━━╋━━━┫
    ┃   ┃   ┃   ┃   ┃
    ┗━━━┻━━━┻━━━┻━━━┛