Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part IH: A Pac-Man Puzzler (20 points) Pac-Man is a video game character who he's fallen on hard tiemes and has heen revuced to eating

image text in transcribed
Part IH: A Pac-Man Puzzler (20 points) Pac-Man is a video game character who he's fallen on hard tiemes and has heen revuced to eating letters of the alphabet. Pac-Man can eat most letters of the alghabet, but he is unable to digest any of the characters in When he reaches one of these characters in a list, he loses his appetise and stops cating Complese ercase letters (with empty. Use underscores normally eats does power pellets, and the occasional ghost. Recently the word "GHOST (uppercase or lowercane) the pacman (line) fonction, which traces Pac-Man's progress through a list of uppercase and low th so spaces, digits, or symlbols) and retorms the final state of the list. The initial list might be a reperesent Pac-Mans () to represent consumed characters and a less-than sign () to final position (either at the very beginning or end of the list, or right I returmed value also includes any uneaten letters of the list before the character that stopped him). The CSE 101-Spring 2018 Homework3 Page 2 For example, consider the list [bh s whinhereaches . t,hecause it is oneof the letters in"GHOST) T-he inallist will be t h'1.Pac-Man can eat the b and theabut ,e, , lf Pac-Man saps eating in the malle of input, you will need to replace consumed with Pac-Man himself. If he eats all the characters in the lisappend ham ithe list. If the first character n the list is from "GHOST simply insert him at the fromt of the list the last character that he saccessfully Hint .1: Use a whilekop to have Pac-M-eat as many characters a possible before stopp-ng. Hint 82: You can use the insert method to insert an item into a list. Take a look at the hetps idocs python.og/3hutorial/datastractures hrml dacumentusion at Examples Function Call pacmanfi'g'.y Return Value pacman(t's. pacman h.o Oo

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

More Books

Students also viewed these Databases questions

Question

5. define task and social cohesion,

Answered: 1 week ago