Assignment 3 ("The Dungeon of Doom": the Inner Sanctum)
New Concepts to be applied for the assignment
• Decomposing a problem into functions (includes concepts such as parameter passing, return values, local variables/scope)
• If you want credit for your work: Do not use any pre-created functions/methods unless you are given explicit permission to do so. [Generic list of allowable pre-created code in the form of python libraries]
Only new concepts that need to be applied in the assignment are listed, concepts previously applied in other assignments may need to used in the implementation of your solution.
Assignment difficulty
Students may find assignments more challenging than they first thought. It's best to start work as early as possible. Tips in the very first lecture were provided but here's two reminders: 1) work through the lecture and tutorial material before looking in detail at the assignments 2) start work as soon as possible. If you find you cannot complete an assignment before the due date then you will not be granted an extension.
Note: it is not sufficient to just implement a working program and expect full credit. This is so you implement your solution in the correct way using good design principles and you apply the necessary concepts. Even if your program is fully working and the program is not designed or implemented as specified in the assignment description (e.g. poor variable names used, named constants, functions not implemented appropriately or insufficiently etc.) then you will not be awarded full credit.
Your program must be decomposed properly into functions. One way of decomposing your program is to implement the processing of instructions for a room as a single function or multiple functions. Because there are three rooms that will mean that your program will consist of at least 4 functions (1 per room plus a starting function). You may be able to subdivide your program using an alternate approach to writing 1 function per room but your program must follow [principles of good design for using functions].
Critical design requirements
All instructions must be enclosed within the body of a function, at least 4 functions must be properly defined. No global variables may be employed. The exceptions could include: import statements (not really needed for this assignment), the creation of global constants (e.g. ATTIC = 1), a global debugging flag and the call to the initial start or main function.
• You will be penalized heavily if functions are not used or improperly used.
o No functions or a single function employed then the max assignment grade = 1.0 grade points
o Two functions properly implemented then the max assignment grade = 2.0 grade points
o Three functions properly implemented then the max assignment grade = 3.0 grade points
o In order to qualify as properly implemented the function must include functionality that is appropriate to that function (e.g. anything related to the attic should not be implemented in a function that includes functionality for the bedroom) and not an empty (e.g. it just includes a pass instruction) or a token implementation (e.g. a few output statements or declarations).
• In a similar fashion you will be penalized heavily if you define or use global variables (global constants are okay, if you don't know the difference refer to the "Intro programming" lectures covered at the start of the term).
o When any global variables (not a debugging flag and not constants) are employed then you will be penalized a full grade point (1.0). To rephrase: This penalty applies if you define one or more global variable(s).
o Example:
location = "bedroom" #Global declared
def processBedroom():
if (location == "bedroom"): #Global referred to in the function.
#Etc.
• What happens if you ignore both of these requirements (sufficient/proper use of functions and the prohibition on the use of global variables).
o If you define no functions or just a single function and your program includes any global variables then you will be awarded no credit for this assignment.
• The function-related & global variable penalties are applied on top of other style penalties but the lowest grade that may be awarded is a GPA of 0 (no negative scores will be awarded).
Contrary to some student rumors it is not the case that penalties exist in order to "curve the grades down" or to only allow a certain number of students to pass the course. Besides learning the mechanics of defining and calling functions you need to use them properly. For instances you shouldn't complete a course that teaches you how to write short stories and pen tales that are grammatically correct and may even use metaphorical references and include multiple characters if they include hackneyed metaphors and shallow character development. Because the penalties are quite strict then typically most/all (hopefully the latter) students will implement their solutions in the correct fashion.
Functional requirements (for the marks allocated for each feature see the marking spreadsheet)
Living room contents: a pot of soil, stairs going up, a dark entranceway, a ball of a string
• Viewing the pot of soil: 1) Default state when viewed, it looks dry 2) After it's been fertilized by the mouse (from the bedroom), when the player views the pot again a vine will grow that takes the player to paradise (game won and the program ends).
• Stairs going up: takes the player to the attic.
• Dark entranceway: takes the player into the bedroom.
• Ball of string: the player can pick up this object. There is only one ball of string, once it has been picked up the string should not appear again in this room.
Attic contents: a tiny hole in the floor, an unlimited supply of cheese, stairs going down.
• Hole: 1) player can pick up some cheese and try to drop it down the hole, the game indicates that the cheese is too big 2) If the player has the string then a new option is provided which is to drop the string down the hole. When this occurs the string should be removed from the player's inventory (the string doesn't reappear anywhere in the game, nor does the option to drop the string down the hole appear again in this room). The effect of dropping the string down the hole will be seen in bedroom.
• Cheese: player can pick some up, the supply of cheese is unlimited so repeatedly picking up the cheese won't diminish the supply (or change the room description). However the game should track that if the player is carrying any cheese (this will allow the player to feed the mouse this cheese in the bedroom).
• Stairs going down: takes the player back down to the living room.
Bedroom contents: a tomcat which is intently watching a mouse hole (default), mouse (after the cat leaves).
• Tomcat: when the player isn't carrying the string no interaction is displayed. When the player is carrying the string then there is a option to use the string to play with the cat. The result is the cat looks briefly at the player and then goes back to watching the mouse hole (the motion isn't enough to greatly distract the cat).
• Mouse: after the player drops the string down the hole from the attic the large motion distracts the cat sufficiently enough to leave the room and he takes the string with him. The mouse then comes out of its hole. Only if the player is carrying some cheese will the game display an option to feed the cheese to the mouse. When this occurs the mouse will leave the room and ahem fertilize the pot of soil. (The vine will grow and the player will win the game when the soil is viewed again from the living room). After fertilizing the soil the mouse will return to the room so there is the possibility of the player repeatedly feeding the mouse (the amount feed to the mouse is negligible so it doesn't change the amount carried by the player). If the player hasn't picked up any cheese or if the mouse has been fed (without picking up any more cheese) then the room description should show that the mouse is in the room but there is no option to interact with it.
• Dark entranceway: takes the player into the living room.
As was the case with the previous assignment each room will provide a description of the contents, display a menu of options (which varies depending upon the actions of the player), get and error check the player's selection and display the menu and description for the room as long as the player remains in that location.
Game walkthrough: because this program is more complex than the previous one the summary map cannot provide details of what the player needs to do in order to win the game. Instead this step-by-step walkthrough specifies what's needed.
1. Living room: Pick up the ball of string.
2. Living room: go up the stairs to the attic.
3. Attic: drop the string down the hole.
4. Attic: pick up some cheese.
5. Attic: go down the stairs back to the living room.
6. Living room: go through the dark entranceway to the bedroom.
7. Bedroom: Feed the cheese to the mouse.
8. Bedroom: go through the dark entranceway back to the living room.
9. Living room: view the pot of soil (and win the game).
Sample outputs of this program:
You can find sample outputs of my solution to this assignment in a link to this [folder].
In addition to grading on whether the above functionality was correctly implemented TAs will also look at documentation and style.
Non-functional assignment requirements (style and documentation).
• Python documentation: contact information (your name, student identification number and tutorial number). This should be specified in the header of the program (very top of your program in the form of Python documentation).
o Identifying information: All assignments should include contact information (full name, student ID number and tutorial section) at the very top of your program.
o Program version (dates are an acceptable alternative)
Under the version you should specify which assignment features were implemented in that version.
o Any program limitations or weaknesses.
o If you don't know how to document a program then refer to the "Intro to programming" section of the course.
o New documentation requirement starting with A3 and applies to all successive assignments: [Inline documentation] (provided just before each function is defined): list the features of each room that were implemented in a particular function.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme