1.1-Introductie-Programmeren

TicTacToe using while-loop

Difficulty: Filled Filled Filled

And on we go with TicTacToe

The program so far prints a game board and asks the player to make the first move. We now have a lot of copied code and the player can only make one move. We can improve on this using the knowledge we have gained. We are going to expand the application in such a way that multiple moves can be made until a player enters ‘0’. We are not ready yet to check for a winner.

You can use your own code for this assignment or start from the sample code supplied with the last exercise.

Put the moves in a while loop. You have to carefully select the code that will go inside and what will stay outside the loop.

Example

Sample output

Example

After some moves: Example

Goodbye message: Example