Question: use python Create a Tic ? tac ? toe board game Requirements: 1) Generate a representation of a 3 by 3 grid of boxes in
Create a Tic?tac?toe board game
Requirements:
-
1) Generate a representation of a 3 by 3 grid of boxes in the Python Shell window to be used as a Tic?tac?toe game board.
-
2) Create a Python list to hold the status (X, O, or unused). The list can be a one dimensional representing the boxes 0?8, or a two dimensional representing rows 0?2 and columns 0?2. The unused value in the array can be a blank space, (empty string), None, or something else you choose.
-
3) Display a message that indicates which players turn it is. Players can be denoted as 1 or 2; X or O; or some other notation that you derive.
-
4) Get input for the first players move. Entry can be row and column, box number, or some other method that you derive. It just needs be clear what the player is expected to enter in order to select a specific box.
-
5) My output that demonstrates steps 1?4 looks like:
|| ----- || ----- ||
It's Player One's turn, pick a box [0-8]: -
6) After getting the players input, the appropriate symbol (X or O) should be displayed in the box that matches the players input.
-
7) If the player selects a box that has already been selected, a message to that effect should be displayed, and that player should go again.
-
8) After the players symbol is placed in the grid, you should repeat the steps starting at #3.
-
9) This should continue until: 1) there are three of the same symbols in any row, 2) there are three of the same symbols in any column, 3) there are three of the same symbols in either diagonal, or 4) there are no more moves allowed, because the grid is full.
-
10) On each of the conditions in #8, an appropriate message needs to be displayed. If it is that row/column/diagonal contain three of the same symbol, the message should include which player is the winner.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
