Question: The final step in producing your string output is to figure cut whether youll be able to eat all unesten pellets in the subarray without

The final step in producing your string output is to figure cut whether youll be able to eat all unesten pellets in the subarray without dying to a ghost. There are four possibilities: 1. If there are ghosts in the subarray and no power pellets, cutput: 'Pac-Man was eaten by ghosts with enumbers uneaten pellets remaining.' 2. If there are ghosts and a power pellet in the subarray, but the pawer pellet is in the same column ar row as a ghost, autput "Pac-Man could not get to the power pellet was eaten by ghosts with enumbers uneaten pellets remaining." 3. If there are ghosts and a power pellet in the subarray, and the power pellet is not in the same column/row as a ghast, output: 'Pac-Man got to the power pellet and ate all enumbers uneaten pellets!' 4. If there are no ghosts in the subarray (irrespective of power pellet presence), autput: 'Pac-Man encauntered no ghasts and ate all enumbers uneaten pellets!' Noteg: - The four quadrants of the map are everily divided, and N will always be an even number. - Pac-Mar will always be in crily one of the quadrants. - The power pellet should nat be included in your total count of uneaten pellets. - There will be no uneaten pellets outside of the quadrant Pac-Man is located in. - There could be mare than cne ghost in the subarray, but there will never be more than coe power pellet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
