Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Description (In python) Our program should be able to display the grid at all stages of the game. Now were going to write a program
Description (In python)
Our program should be able to display the grid at all stages of the game. Now were going to write a program that allows the user to enter a string representing the game state and correctly prints the 3x3 game grid based on this input. Well also add some boundaries around the game grid.
Objectives
In this stage, you will write a program that:
- Reads a string of 9 symbols from the input and displays them to the user in a 3x3 grid. The grid can contain only X, O and _ symbols.
- Outputs a line of dashes --------- above and below the grid, adds a pipe | symbol to the beginning and end of each line of the grid, and adds a space between all characters in the grid.
Examples
Examples below show how your output should look. Notice that after Enter cells: comes the user input.
Example 1:
Enter cells: O_OXXO_XX --------- | O _ O | | X X O | | _ X X | ---------
Example 2:
Enter cells: OXO__X_OX --------- | O X O | | _ _ X | | _ O X | ---------
Example 3:
Enter cells: _XO__X___ --------- | _ X O | | _ _ X | | _ _ _ | ---------
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started