Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help showing how the steps are completed!!!! 1. The next options will be to add the ability to ll in the grid with

I need help showing how the steps are completed!!!!

image text in transcribedimage text in transcribed
1. The next options will be to add the ability to ll in the grid with random data. 2. Add two menu items to the options menu, one for Randomize and one for Randomize with Seed. 3. Since the built in random number generator requires a seed in order to properly function, there will be two options. The default will be to use the current time. The other will option will prompt the user for a number to use as a seed. Something similar to this option can be seen in the game Minecraft. Menu Options 1. Append two new items to the options menu object, one for Randomize and one for Randomize with Seed. 2. The ID's ofthese options will be important for the events table. 3. Create two new event handlers, one for each option, and add them to the event table. 4. Each event handler should call a method written to randomize the grid. It should take in an int as an argument. 5. The default randomize option will pass time[NULL} into the method. 6. The randomize with seed option will need to prompt the user for a number to use as the seed. a. A custom dialog could be created using the procedure from creating the settings dialog. b. Prompting for a number is such a common task that wxWidgets provides an easy way to do this. c. There is a method called wxGetNumberFromUser that will take in some text options and return a number. It will be necessary to include wxfnumdlg.h for this to work. By default the dialog will allow a max value of 10D. That number can be made much larger, so explore the initialization options to see about settings it to something like Lo NG_MAX. Randomizing the Grid 1. The first step in randomizing the grid is going to be to provide srand with the seed. 2. It will now be necessary to loop through the entire game board and, using the random number generator, determine if each square is alive or dead, 3. There are some decisions that need to be made here. a. If half the board should be living, then the determination should be based on whether the random number is even or odd. b. If a different number of living cells is desired, the calculation will need to be different. c. Checking if the random number is divisible by 3 would make about 1/3 of the board living. d. Checking the random number modulus 100 against an inequality would provide even more granular results. num % 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

=+What is the surplus output at that population level?

Answered: 1 week ago