Presented by
The Pac Man Guided by
Prof. Harshil Sir Mahek Sadhwani
Piyush Kukade
Description Algorithms Implementation Screenshots
• Pac-Man is a classic video game. It is • The A* Algorithm enables the ghosts to
considered to be one of the most reach the Pac-Man with the shortest
distance so that Pac-Man finds it difficult
influential video games of all time.
to complete this game. This is used to
increase the game difficulty.
• The player is placed in a maze filled • A randomized version of Depth First
with food (dots) and needs to eat all Search Algorithm is used to generate the
of it to advance to the next level. maze. DFS can also be adapted to find all
Data Structures the paths by only including nodes on the
current path in the visited set.
• This task is made difficult by four
• Breadth first search (BFS) is a graph
ghosts that pursue Pac-Man through • List Data structure is majorly used search algorithm. If all nodes are
the maze. If Pac-Man makes contact during the implementation of Pac Man. accessed, the algorithm aborts. It uses
with any of the ghosts, the player Lists are used to store the co-ordinates Queue to store visited nodes.
of the Pac-Man and the 4 ghosts. Lists • Dijkstra ‘s Algorithm tries to find all the
loses a life and the positions of Pac-
are also used to calculate the offset immediate vertices reachable from Pac-
Man and the ghosts are reset back to values.
their starting locations. Man and the ghosts try to cover as many
• Arrays are used in storing the of these vertices by ghosts. So, the References
incrementing score. The whole maze of possibility of Pac-Man to escape become
the Pac-Man is built using an array. less. • Cormen, Thomas H., Charles E. Leiserson, and Ronald L.
• Graphs in Pac-Man are implemented to • The minimax algorithm performs a Rivest. p.606https://en.wikipedia.org/wiki/Depth-
locate valid directions and all the depth-first search algorithm for the first_search
possible paths. They are mostly used by • https://www.researchgate.net/publication
exploration of the complete game tree. It • https://inst.eecs.berkeley.edu/~cs188/fa18/assets/notes/n3.
various traversal algorithms. uses recursion to search through the pdf
• The DFS algorithm uses Stack to push game-tree. This limitation of the minimax • https://courses.cs.washington.edu/courses/cse473/15au/ass
the (x, y) co-ordinates. It uses stack to algorithm can be improved from alpha-
ign/project1/project1.html
• https://www.cs.swarthmore.edu/~meeden/cs63/s15/search.
keep track of the generated nodes. The beta pruning. html
last generated node is the first one • Alpha – Beta Pruning Algorithm is a • https://www.101computing.net/pacman-ghost-algorithm/
chosen for expansion.
more efficient version of Minimax. This • https://11011110.github.io/blog/2013/12/17/stack-based-
• Trees are used by the ghosts to generate
algorithm filters some irrelevant paths graph-traversal.html
the best possible path to attack the Pac- • https://en.wikipedia.org/wiki/Maze_generation_algorithm
and determines only the best paths for
Man. When Pac-Man navigates around
Pac-Man. • http://theory.stanford.edu/~amitp/GameProgramming/ASta
the maze, it must decide where it
rComparison.html
should explore next.
Tree is used to find the next node. • https://towardsdatascience.com/how-a-chess-playing-
computer-thinks-about-its-next-move-8f028bd0e7b1