March 5, 2005

Program / Task Name:




 Novice / Advanced

Point Value:






Data File(s):,

C programmers: your program name must be: prob10.exe
JAVA programmers: your program name must be: prob10.class


Task Description

Given an input of a grid denoting the starting screen of a simple game of PacMan and an input file with a list of joystick commands (U = Up, D = Down, L= Left, R = Right), your program must calculate the ending score of the game.  Each specific crumb or fruit at a particular location in the grid may only be eaten once per game.

Characters in the grid:

PacMan = P

Ghost = @ (you lose! game over)

Wall = # (blocks movement)

Portal = ] or [ (sends Pacman to opposite side of grid)

Crumb = . = 1 pt.

Target = * = 10 pts

Cherries = % = 25 pts

Watermelon = O = 50 pts


Program Input

Grid input file (


Moves input file (



Program Output

81 pts.



  (c) 2005 Hewlett-Packard Company