• Teaser Home

    Clean Code Developer School

    Saubere Softwareentwicklung üben – regelmäßig, fokussiert, individuell, angeleitet

Tic Tac Toe

Application Kata „Tic Tac Toe“

Implement a console application fort wo players playing [Tic Tac Toe].

By running the program a new game is started. It is displayed like the following:

The players move alternately by entering the coordinate of a field where they will place their token as a command [1] for example „A0“ or „C2“. The symbol for player 1 is „X“ and for player 2 it is „O“.

If a player tries to place the token on a field that is filled already the game board is displayed again without any changes and the player can try again.

The game board is displayed after each move. If player 1 moves to A0 and player 2 moves to B1 the game board looks like the following:

Entering “new” as a command starts a new game.

By entering „exit“ one can quit the program.

The game is over if no more moves are possible or one player won the game. A message will be displayed like the following:

If the game is over only the commands „new“ and „exit“ are accepted.


[Tic Tac Toe] https://en.wikipedia.org/wiki/Tic-tac-toe


[1]The commands should be understood without considering upper or lower case.