Question: I need help with C++ programing Objective: To create a Rullo Game using ToggleInt class(ToggleInt.h), ToggleGrid class(ToggleGrid.h), Rullo class(Rullo.h) and Driver.cpp. The ToggleGrid class to
I need help with C++ programing
Objective: To create a Rullo Game using ToggleInt class(ToggleInt.h), ToggleGrid class(ToggleGrid.h), Rullo class(Rullo.h) and Driver.cpp.
The ToggleGrid class to allow different dimensions and implement the Rullo game.
How Rullo Game works can be found in "https://www.youtube.com/watch?v=ex6SaWUse2E". First, the revisions you need to make:
Procedure --------- 1. The ToggleInt class
a. Because of how you will probably insert values into the ToggleGrid class, you will probably want to add a constructor that takes the value (m_int in the sample solution) as a parameter.
2. The ToggleGrid class
a. ROWS and COLS (or whatever you called them) are no longer constants. Remove the const, make them fields of ToggleGrid if you have not already done so, and rename them using lowercase. One best practice that really does carry over from college to work is that constants get named with all-uppercase while regular variables mostly use lowercase. The main possible exception is the first letter of a word within the name (as in sameRank).
b. The grid of values should now be a vector of vectors of ToggleInts: vector
c. The constructor should still take a list of values, but it should also take int parameters for the dimensions of the gird, number of rows firsts, then number of columns. Remember that when inserting values, you have to insert a ToggleInt, not just an int (the constructor suggested above should help)
3. The Rullo class (in rullo.h)
a. This is the class that implements the game. The game does not have to absolutely follow the version on the coolmath site, and there is additional tracking of overall performance there, but the program must:
i. Support letting the user choose different dimensions for the game and have a range of valid values.
ii. Support solutions that have squares that are toggled off
iii. Correctly detect when the player has found the solution
iv. Give guidance on whether the player is correct for a given row or column. You can simply list which rows and columns are correct, or you can list the sums for the current state of the players grid vs. the sums for the solution, or perhaps some other approach.
b. It is ok to have the user input the values and indicate either the sums for the rows/columns or which values are toggled on/off for the solution, but you may find it more interesting to randomly generate the values.
c. You must also use the ToggleGrid to store the values and manage the user interactions (specifically, toggling). Rewriting everything to use arrays of ints (even if you separately declare a vector) will not receive any credit for this section.
d. You must define a constructor that takes the dimensions of the board and the minimum and maximum for a value on the board.
e. There also must be a void function called play() which does not take any parameters. This will play one puzzle.
i. Include instructions on how to play
ii. Allow the user to quit in the middle
4. The driver (river.cpp) is a bit more simple than the previous drivers.
a. In your main, describe what the program does
b. Using a local variable of type Rullo, play the game by calling its play() method
c. If you like you can put this call inside a loop that asks the player after each game whether they have had enough or want to play another game.
Thank you in advance
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
