Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this Question, you are asked to print a tic-tac-toe board so players can see each other's markings Task 1: Define a board as nested
In this Question, you are asked to print a tic-tac-toe board so players can see each other's markings Task 1: Define a board as nested list (2 Points) Define a global variable "board" which represents a tic-tac-toe board. (Beware of the variable scope List element board[O][0] denotes the upper left cell of 3X3 board. All other coordinates are explained below, List Index Coordinate Board Location [o0 1,1 01] 1,2 [0][2 1,3 [110 2,1 11] 2, 2 [1112 2, 3 210 3,1 upper left upper center upper right middle left middle center middle right lower left lower center 2112 3, 3 lower right Scoring rubrics 1. Correctly defines variable "board" (1 Point) 2. Initialize each element with a white space(1 Point) Task 2: Print out a board (4 Points) The function is specified as follows: 1. Function name is print board (1 Point) 2. It takes one argument named "board" (1 Point) 3. Use capitalized "X" and "O" to mark players' moves 4. Separate each row with 5 hyphens 5. Separate each column a vertical pipe "T 6. Correctly print all 2**9-512 possible variants of gameplay (2 Point) Sample printouts o1XIX o1OIX Task 3: Print out a board (1 Point) In the Python entry point (which should look like the following code snippet) if name main ": pass print out a mid-game board shown below O1XI 01
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