Menu

[solved]-Create Simple Version Game Life Write Python Program Tests Function Main Functions Discuss Q39052310

You will create a simple version of Game of Life.

Write a Python program that tests the function main and thefunctions discussed in step1 through 7.

1. Declare two global variables:

MAX_ROW = 30 – # total number of rows
MAX_COL = 60 – #total number of columns

2. Declare 2 two-dimensional lists with zeros (integer) asinitial values using the size specified in step 1.
currentGen and tempGen

3. Write the definition of the functiondisplayMenu that displays the following menu; thisfunction doesn’t collect the user’s input; only display thefollowing menu.

[P]lay – Press ‘P’ to play. [Q]uit – Press ‘Q’ to exit.

4. Write the definition of the functionsetZeroList that initializes any two-dimensionallist to 0 (zero).

5. Write the definition of the functionsetInitialPatternList that creates the pattern of‘U’ using ‘1’ in anytwo-dimensional list (use for loop). The following shows a portionof an 2-D list. Use the predefined randint()function to determine the row and column of the first1 (bold). The size of the ‘U’ pattern must be thesame as the below example (6 rows and 7 columns).

000000000010000010010000010010000010010000010010000010011111110000000000

6. Write the definition of the functioncopyList that copy a two-dimensional list toanother two-dimensional list.

7. Write the definition of the functiondisplayList that prints any two-dimensionallist.

8. When executing your program, the following shouldhappen:
a. Print the menu using the displayMenufunction.
b. Initialize the tempGen using thesetZeroList function.
c. Set the ‘U’ pattern in thetempGen using thesetInitialPatternList function.
d. Copy the tempList to thecurrentList using the copyListfunction.
e. Print the currentList using thedisplayList function.
f. When the user presses ‘P’, you will repeat athrough e only once.
When the user presses ‘Q’, it will terminate the program.

***Define the functions in the beginning, not in themiddle of your code.

***No object-oriented programming.

OUTPUT:

**************************************************************************************************************

[P]lay-Press P to play. [Q]uit-Press Q to exit. 0000000000000000000000000000000000000000000000000000000000 00000000000000

[P]lay-Press p to play. [Q]uit-Press Q to exit. [ 000000000000000000000000000000000000000000000000000000000000 0000000000

[P]lay-Press p to play. [Q]uit-Press Q to exit. 000000000000000000000000000000000000000000000000000000000000 000000000000

[P]lay-Press ‘P’ to play. [Q]uit-Press ‘Q’ to exit. 0000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 | oooooooooooooooooooooooooo0000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 । 000000000000000000000000000000000000000000000000000000000000 | 000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000 000000000000000000000100000100000000000000000000000000000000 000000000000000000000111111100000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000। 000000000000000000000000000000000000000000000000000000000000 । 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 | 000000000000000000000000000000000000000000000000000000000000 | >>p [P]lay-Press ‘p’ to play. [Q]uit-Press ‘Q’ to exit. [ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000011111110000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 Ꮎ00000000000000000000000000000000000000000000000000000000000 Ꮎ00000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 Ꮎ00000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [ >>p [P]lay-Press ‘p’ to play. [Q]uit-Press ‘Q’ to exit. 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [000000000000000000000000000000000000000000000000000000000000 [000000000000000000000000000000000000000000000000000000000000 [ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [ 000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000 [000000000000000000000000000000000000000000000000000000000000 [000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000100000100000000000 [000000000000000000000000000000000000000000100000100000000000 000000000000000000000000000000000000000000100000100000000000 [ 00000000000000000000000000000000000000000100000100000000000 000000000000000000000000000000000000000000100000100000000000 000000000000000000000000000000000000000000111111100000000000 [ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [00000000000000000000000000000000000000000000000000000000000 Show transcribed image text [P]lay-Press ‘P’ to play. [Q]uit-Press ‘Q’ to exit. 0000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 | oooooooooooooooooooooooooo0000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 । 000000000000000000000000000000000000000000000000000000000000 | 000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000 000000000000000000000100000100000000000000000000000000000000 000000000000000000000111111100000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000। 000000000000000000000000000000000000000000000000000000000000 । 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 | 000000000000000000000000000000000000000000000000000000000000 | >>p
[P]lay-Press ‘p’ to play. [Q]uit-Press ‘Q’ to exit. [ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000010000010000000000000000 000000000000000000000000000000000000011111110000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 Ꮎ00000000000000000000000000000000000000000000000000000000000 Ꮎ00000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 Ꮎ00000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [ >>p
[P]lay-Press ‘p’ to play. [Q]uit-Press ‘Q’ to exit. 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [000000000000000000000000000000000000000000000000000000000000 [000000000000000000000000000000000000000000000000000000000000 [ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [ 000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000 [000000000000000000000000000000000000000000000000000000000000 [000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000100000100000000000 [000000000000000000000000000000000000000000100000100000000000 000000000000000000000000000000000000000000100000100000000000 [ 00000000000000000000000000000000000000000100000100000000000 000000000000000000000000000000000000000000100000100000000000 000000000000000000000000000000000000000000111111100000000000 [ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 [00000000000000000000000000000000000000000000000000000000000

Expert Answer


Answer to You will create a simple version of Game of Life. Write a Python program that tests the function main and the functions … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *