For this coursework, you will have to implement a classifier. You will use this classifier in some code
that has to make a decision. The code will be controlling Pacman, in the classic game, and the
decision will be about how Pacman chooses to move. Your classifier probably won’t help Pacman
to make particularly good decisions (I will be surprised if it helps Pacman win games, my version
certainly didn’t), but that is not the point. The point is to write a classifier and use it.
No previous experience with Pacman (either in general, or with the specific UC Berkeley AI imple
mentation that we will use) is required.
This coursework is worth 10% of the marks for the module.
Note: Failure to follow submission instructions will result in a deduction of 10% of the marks you
earn for this coursework.
2 Getting started
2.1 Start with Pacman
The Pacman code that we will be using for the coursework was developed at UC Berkeley for their AI
course. The folk who developed this code then kindly made it available to everyone. The homepage
for the Berkeley AI Pacman projects is here:
Note that we will not be doing any of their projects. Note also that the code only supports Python
3, so that is what we will use1.
(b) Save that file to your account at KCL (or to your own computer).
(c) Unzip the archive.
This will create a folder pacman
(d) From the command line (you will need to use the command line in order to use the various
options), switch to the folder pacman.
(e) Now type:
This will open up a window that looks like that in Figure 1
(f) The default mode is for keyboard control, so you should be able to play this game out using
the arrow keys.
Playing Pacman is not the object here | don’t worry if there is an issue with controlling Pacman
using the keys, that can happen on some platforms | but you will need to run this code to do the
coursework. So, if the code causes an error, get help.
When you are tired of running Pacman, move on to the next section.