Assignment Two
In this assignment you will refactor the program to improve its design without necessarily changing its functionality. You may fix some bugs along the way, or make the game more to your liking, but the core work is to refactor the code.
You should start from the code published in the “assignments” branch of the workshops repository. We encourage you to make a fresh clone of this branch (in a separate folder on your computer) rather than trying to integrate it with your other work.
We have also provided three videos to help you understand the code in that branch:
which describes our published solution to assignment one.
which goes over more states the game uses.
Identify a good pattern (33 marks)
There are a number of possible patterns – including ones we have not studied – for improving this code. Your job is to identify the one you think is most appropriate and explain why you think this.
Your submission should include a file PATTERN.md that names the pattern and explains why you chose it
NOTE: Only consider patterns found in “Head First Design Patterns”.
Refactor (34 marks)
Implement the pattern. You must be faithful to the pattern as described in the book. If you must depart from it, then you must describe why this was necessary in a file DEPARTURES.mdwhich names the pattern and the ways you departed from it, as well as explains why you made each change.
Further Improvements (33 marks)
You should have found other design improvements you would like to make (ideally at least 3, worth 11 marks each). In a file called IMPROVEMENTS.md. Include the file names and line numbers for each and a description of why you think it is an improvement. These can be very small changes, a bug-fix here or a magic-number there; we want to see that you can write about your design and coding choices.
Above and Beyond (no marks): 🤔
Let your imagination go wild, if you have no imagination, you might like to try:
• Improve the aesthetics of the game.
• Build some challenging levels
If you attempt this task, include a ABOVE_AND_BEYOND.md file explaining what you did.
Submission
You must submit a zipped VSCode project. Your maker will download your zip file, open it in VSCode and run it from there. Please don’t submit unnecessary temporary files (such as class files) in your zip file.