Project Logistics

When you finish the project, you'll have implemented a significant part of this game yourself.

To get started, download all of the project code as a zip archive from course website or from QQ group. Below is a list of all the files you will see in the archive once unzipped. For the project, you'll only be making changes to hog.py.

  • hog.py: A starter implementation of Hog
  • dice.py: Functions for rolling dice
  • hog_gui.py: A graphical user interface (GUI) for Hog (updated)
  • ok: The autograder
  • tests: A directory of tests used by ok
  • gui_files: A directory of various things used by the web GUI

You may notice some files other than the ones listed above too -- those are needed for making the autograder and portions of the GUI work. Please do not modify any files other than hog.py.

You will turn in the following files:

  • hog.py

You do not need to modify or turn in any other files to complete the project. To submit the project, run the following command:

$ python ok --submit

For the functions that we ask you to complete, there may be some initial code that we provide. If you would rather not use that code, feel free to delete it and start from scratch. You may also add new function definitions as you see fit.

However, please do not modify any other functions. Doing so may result in your code failing our autograder tests. Also, please do not change any function signatures (names, argument order, or number of arguments).

Throughout this project, you should be testing the correctness of your code. It is good practice to test often, so that it is easy to isolate any problems. However, you should not be testing too often, to allow yourself time to think through problems.

We have provided an autograder called ok to help you with testing your code and tracking your progress. Each time you run ok, it will back up your work and progress on our servers. The primary purpose of ok is to test your implementations and backup your code.

If you want to test your code interactively, you can run

$ python ok -q [question number] -i

with the appropriate question number (e.g. 01) inserted.
This will run the tests for that question until the first one you failed, then give you a chance to test the functions you wrote interactively.

You can also use the debugging print feature in ok by writing

print("DEBUG:", x)

which will produce an output in your terminal without causing ok tests to fail with extra output.