Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need help putting this into python def better board(size, zeros on diag 1, zeros on diag 2): This will be a slightly nicer game board
need help putting this into python
def better board(size, zeros on diag 1, zeros on diag 2): This will be a slightly nicer game board than simple_board can produce. This board has straight edges around the outside (except the corners) and allows you to fill one (or both) diagonals with zeros. The first parameter is size (like simple_board(), the second parameter indicates if the diagonal from the top left to the bottom right should be filled with Os, the third parameters is for the top right to bottom left diagonal Size 2 Board No Diag. Size 3 Board, 1st Diag.Size 4 Board, 2nd Diag. Size 5 Board, Both Diag I I l0l I l0l I l0l I 1 101 l ll llI I I lel II ol lo lel I lel II Return value a string of the game board Assumptions o size will be a positive integer o zeros_on_diag_1 and zeros_ on_diag_2 will be booleans Notes: o o Hint 1: This will be much easier if you use nested loops. Hint 2: Work on the board without diagonals first. Once that is working, try doing the first diagonal (it's easier than the second one). Once that is working, try the second diagonal. Make sure to return a string, not print a string o def better board(size, zeros on diag 1, zeros on diag 2): This will be a slightly nicer game board than simple_board can produce. This board has straight edges around the outside (except the corners) and allows you to fill one (or both) diagonals with zeros. The first parameter is size (like simple_board(), the second parameter indicates if the diagonal from the top left to the bottom right should be filled with Os, the third parameters is for the top right to bottom left diagonal Size 2 Board No Diag. Size 3 Board, 1st Diag.Size 4 Board, 2nd Diag. Size 5 Board, Both Diag I I l0l I l0l I l0l I 1 101 l ll llI I I lel II ol lo lel I lel II Return value a string of the game board Assumptions o size will be a positive integer o zeros_on_diag_1 and zeros_ on_diag_2 will be booleans Notes: o o Hint 1: This will be much easier if you use nested loops. Hint 2: Work on the board without diagonals first. Once that is working, try doing the first diagonal (it's easier than the second one). Once that is working, try the second diagonal. Make sure to return a string, not print a string oStep 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