Problem 1231. PACMAT Easy
The Classic PACMAN game brought to Cody.
PACMAT_Easy is the simple case of clearing the board of Yellow Dots while not bumping into the non-moving ghosts.
To aid in development of your routine, a PACMAT.m file that creates a video has been posted at PACMAT_Easy.m. (Right click, 'save link as'). Using patches (not sprites).
An example video of the first Player PACMAT_Easy_Video (MP4: Left click and Windows Media Player)
Alfonso Nieto-Castanon's 298 PACMAT Video
Alfonso employed a Local Optimum Monte-Carlo approach to find a best solution. Solution #8 is the very compact non-apriori PACMAT solver.
Inputs: Map Definitions: -1=Wall, 0=Empty, 1=Dot, 2=PACMAT, >2=Ghost
Output: Direction Definitions: 1-Up, 2-Right, 3-Down, 4-Left, 0-No move
Scoring: Total # of Moves to Clear the Yellow Dots
Near Future: Ghosts will move with various algorithms.
Far Future: Asteroids and Space Invaders
Solution Stats
Problem Comments
-
4 Comments
very cool, love the problem!
Agreed, although (unlike you) I'm not clever enough to solve it without a joystick...
FOR THOSE WHO WANNA MAP IT AS YOU GO, for shigs
I already made the map for ya (DL the png, the fig takes more mem. to load in)
https://drive.matlab.com/sharing/967b8ae8-4cc3-4979-bc17-558709c8a09c
Easy as ...
map1 = imread('Map1.png');
map1 = imresize(map1, [M*18, N*18]);
imshow(map1);
Then when you're plotting your points, multiply the coordinate by 18 and shift x by -8 and y by +9
i.e.
xShift = -8; yShift = 9;
x = j*18 + xShift; y = (M-i+1)*-18 + M*18 + yShift;
Fun stuff. Haven't solved the problem yet but I'm loving it (spending too much time on the graphics probably :D )
OH and the RGB for the ghosts is...
gh1 = [1 0 0]; % BLINKY (red)
gh2 = [20 299 228]/255; % INKY (blue)
gh3 = [226 147 228]/255; % PINKY (pink)
gh4 = [228 153 59]/255; % CLYDE (orange)
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
276 Solvers
-
567 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1072 Solvers
-
600 Solvers
-
286 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!