Noughts and crossed (aka TicTacToe) is a simple two player game. Players take it in turns of marking a square in 3x3 grid with a nought O
or a cross X
. A player wins by having three of their marks in any row, column or diagonal.
This version works but needs cleaning up, good luck!
- Are there any builtins you can use to simplify the logic?
- Can you separate game logic and display logic?
- Can you make the NoughtsAndCrosses class testable?
- Think about extensibility, how would it be easy to:
- Add computer players
- Allow undos
- Replay all moves by printing out all positions from the start
- Play multiple games and keep score