Write a python program that simulates a lo shu magic square using a two-dimensional list. The program should initialize a two-dimensional list with trial values. Don't ask for values as user input. Program must determine if the array is a Lo Shu Magic Square. These contain numbers 1-9 and have 3 rows and 3 columns. I want to use the following functions in the program: drawBoard(): No return value. Takes a two-dimensional list as input. Prints the Lo Shu Magic Square. isWinner(): Returns True when all the winning properties are satisfied. Takes a two-dimensional list as input. checkNumbers(): Returns True when the digits 1-9 exactly are used. Takes a two-dimensional list as input. checkRows(): Returns True when the sums of the rows are the same. Takes a two-dimensional list as input. checkColumns(): Returns True when the sums of the columns are the same. Takes a two-dimensional list as input. checkDiagonals(): Returns True when the sums of the diagonals are the same. Takes a two-dimensional list as input.
Write a python
drawBoard(): No return value. Takes a two-dimensional list as input.
Prints the Lo Shu Magic Square.
isWinner(): Returns True when all the winning properties are satisfied.
Takes a two-dimensional list as input.
checkNumbers(): Returns True when the digits 1-9 exactly are used.
Takes a two-dimensional list as input.
checkRows(): Returns True when the sums of the rows are the same.
Takes a two-dimensional list as input.
checkColumns(): Returns True when the sums of the columns are the same.
Takes a two-dimensional list as input.
checkDiagonals(): Returns True when the sums of the diagonals are the same.
Takes a two-dimensional list as input.
I will attach a picture of the code I've tried so far.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images