Question: Create functions: using python program Initialization print Setting up the game Teardown print Destroying the game Accept Input accept a letter for a command. The
Create functions: using python program
- Initialization print Setting up the game
- Teardown print Destroying the game
- Accept Input accept a letter for a command. The commands are the things that you can do to the board: Flag a square, unflag a square, assert that the square is bomb-free, and quit the game. Accept coordinates if appropriate. Prompt and error check appropriately.
- Update the state of the world pass the input data to this function. Since we do not have a world right now, choosing (0,0) as bomb free will print BOOM, other moves will print OK
- Display the state of the world Print the result calculated in the state of the world. Later, this should print the board.
- Main call initialization, then loop until a flag is set, calling accept input, update and display. Outside of the loop, call teardown.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
