Question: C++ assignment create a small game that simulates the control of the Mars Rover Create a class named Map which would be used to create

C++ assignment

create a small game that simulates the control of the Mars Rover

Create a class named Map which would be used to create the following: - The actual Map of Mars, which is to be hidden from the user and will only be displayed to the user at the end of the game. - The Mars Rover Mapper, which keeps track of the cells in the map the Rover had already observed.

Create a class named Rover, which would be used to keep track of the location and heading of the Rover

The class declarations above are only the bare minimal, you may want to add member functions and data member such as for keeping track of golds collected etc.

The data type Direction can be defined using enumeration

As the Rover moves across the map, it would be able to read the three cells just in front of it.

There are hills on the map which prevent the Rover from moving to those cells.

There are traps on the map, if the Rover moves to any of those cells, the mission is failed

You are free to design your scoring system and other type of cells, you may also introduce new challenges for the Rover

C++ assignment create a small game that simulates the control of the

Sample Session of a Demo Program is shown below. Let's explore Mars... Mars dimension X => 15 Mars dimension Y => 5 No of Golds => 4 ---- Mars Rover Mapper__----- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5|?|?|?|?|?|?|?|I1|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|?|?|?|?|?|?|?| ?|?|?|?|?|| +-+-+-+-+ --+-+-+-+-+-+ 31?|?|?|?|?|?|?|I ||?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2|?|?|?|?|?|?|?|vl|?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1|?|?|?|?|?|?|?|||#|?|?|?|?|?| -+-+ -+-+-+-+-+-+-+ 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+- --_--_ Mars Rover Mapper_--_- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|?|?|?|?|?|?|?|?| ?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 31?|?|?|?|?|?|?|I |?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 21?|?|?|?|?|?|?|?| ?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 Mission: Get all the golds!!, Do not get trapped!! L=Turn Left, R=Turn Right, M=Move, Q=Quit Hill #Trap *=Gold Total Command Sequences = 1 [S] Total Commands = 7 [C] Total Golds = 0 [G] out of 4 Total Score = [G] x 50 - [S] x 5 - [C] x 1 = -12 Mission: Get all the golds!!, Do not get trapped!! L=Turn Left, R=Turn Right, M=Move, l=Quit =Hill #Trap *=Gold Example Sequence: MMLMMMRMMRMRMLLL Enter command sequence => RMRMMMRM Total Command Sequences = 0 [S] Total Commands = 0 [C] Total Golds = 0 [G] out of 4 Total Score = [G] x 50 - [S] x 5 - [C] x 1 = 0 Example Sequence: MMLMMMRMMRMRMLLL Enter command sequence => MLMLLMM Mars Rover Mapper +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 51?|?|?|?|?|?|I>11|?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|?|?|?|?|?|?|III??|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3|?|?|?|?|?|?|I ||?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 21?|?|?|?|?|?|II||?|?|?|?|?| +-+-+-+-+ +-+-+-+-+-+-+ 1|?|?|?|?|?|?| #1 ||#|?|?|?|?|?|| --_--_ Mars Rover Mapper_--_- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|?|?|?|?|?|?|?|?| ?|?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Sample Session of a Demo Program is shown below. Let's explore Mars... Mars dimension X => 15 Mars dimension Y => 5 No of Golds => 4 ---- Mars Rover Mapper__----- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5|?|?|?|?|?|?|?|I1|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|?|?|?|?|?|?|?| ?|?|?|?|?|| +-+-+-+-+ --+-+-+-+-+-+ 31?|?|?|?|?|?|?|I ||?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2|?|?|?|?|?|?|?|vl|?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1|?|?|?|?|?|?|?|||#|?|?|?|?|?| -+-+ -+-+-+-+-+-+-+ 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+- --_--_ Mars Rover Mapper_--_- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|?|?|?|?|?|?|?|?| ?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 31?|?|?|?|?|?|?|I |?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 21?|?|?|?|?|?|?|?| ?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 Mission: Get all the golds!!, Do not get trapped!! L=Turn Left, R=Turn Right, M=Move, Q=Quit Hill #Trap *=Gold Total Command Sequences = 1 [S] Total Commands = 7 [C] Total Golds = 0 [G] out of 4 Total Score = [G] x 50 - [S] x 5 - [C] x 1 = -12 Mission: Get all the golds!!, Do not get trapped!! L=Turn Left, R=Turn Right, M=Move, l=Quit =Hill #Trap *=Gold Example Sequence: MMLMMMRMMRMRMLLL Enter command sequence => RMRMMMRM Total Command Sequences = 0 [S] Total Commands = 0 [C] Total Golds = 0 [G] out of 4 Total Score = [G] x 50 - [S] x 5 - [C] x 1 = 0 Example Sequence: MMLMMMRMMRMRMLLL Enter command sequence => MLMLLMM Mars Rover Mapper +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 51?|?|?|?|?|?|I>11|?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|?|?|?|?|?|?|III??|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3|?|?|?|?|?|?|I ||?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 21?|?|?|?|?|?|II||?|?|?|?|?| +-+-+-+-+ +-+-+-+-+-+-+ 1|?|?|?|?|?|?| #1 ||#|?|?|?|?|?|| --_--_ Mars Rover Mapper_--_- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|?|?|?|?|?|?|?|?| ?|?|?|?|?|?| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!