Question: I need help creating a hex grid in c++ and finding the shortest path between 2 objects. This is the critieria: Planet X is the

I need help creating a hex grid in c++ and finding the shortest path between 2 objects. This is the critieria:

Planet X is the only known location of Illudium Phosdex, the shaving cream atom. The planets

surface can be modeled as a 20 x 20 hexagonal map, shown on page 3.

The surface of Planet X is rather plain, except for areas of molten lava, over which neither Duck

Dodgers nor Marvin the Martian can pass. The Illudium Phosdex resides in one non-lava cell on the

map.

The basic goal of this project is simple: assuming that Dodgers and Marvin move at the same rate,

which one can reach the Illudium Phosdex first?

The program must begin by reading seven integers: the row and column of Duck Dodgers starting

position, the row and column of Marvin the Martians starting position, the row and column of the

location of the Illudium Phosdex, and the number of map cells covered in lava.

Next, for each lava cell, the program must read the row and column of the lavas location.

Once the data is read, find a shortest path from both Marvin and Dodgers to the Illudium Phosdex.

Output a shortest path from both characters to the goal, and determine who will claim the Illudium

Phosdex. Break any ties in favor of Marvin the Martian (he has a disintegration gun that doesnt

disintegrate, and hes not afraid to use it).

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!