To the faculty page of James Tam | Return to the course web page |
Due at 4 PM. For assignment due dates see the main schedule on the course webpage. The program must be written and run under python version 3.X.
Link to things that were missing or incorrect in some of the student A1 submissions:
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 not used when they should have employed etc.) then you will not be awarded full credit. For some assignments your grade may be greatly reduced. For example, in all the later assignments you need to employ functional decomposition and do so in a the proper specified manner. If you do not do this then your maximum assignment grade point could be as low as 1.0 GPA even with a fully working program. Although the earlier assignments will not have marking requirements which are quite as strict take care to read the specific details provided in each assignment which is provided under the "Marking and grading" section of each 'full' assignment. The marking of the mini-assignments will focus on program functionality.
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.
Write a text-based "choose your own" adventure game. There will be three 'rooms' in the game world, within each room the player will see a number of choices and the program will react to the player's selection. The game will repeatedly run the game via a main loop. This loop contains most of the instructions of the program and it runs until the game has been won.
The goal of this mini-game is to open the locked door inner to access the rest of the house. When the door has been unlocked the player can return to the entrance room and open the door to the rest of the house satisfying the goal of this mini-game (which is to gain access the inner sanctum of the house). When this occurs the main loop ends and a suitable congratulatory message should be displayed and the program ends.
Sample program output:
A text file ["output_normal_play.txt"] shows sample execution of my solution with a normal play through (no erroneous selections). Another text file ]["output_invalid_selections.txt"] illustrates what should happen when the player selects an option that isn't listed.
Entrance room description
The player begins the game in the entrance. The door that brought the person into the house is gone (it's a "one-way portal"). When the player is in this room the game will describe the list of possible actions:
- Try to open the door
- Go through the left entryway
- Go through the right entryway
As mentioned the player cannot open the inner door until it has been unlocked. The player can freely pass through either entryway with no conditions. Entering a non-existent selection will result in a suitable helpful error message (refer to the last section of the 'repetition' notes, rules of thumb for how to write good error messages) and the above options are displayed again. The program does not have to handle cases where an invalid type of information (e.g. string instead of number) has been entered. (However the inability to handle invalid types should then be documented as a ["program limitation"]). As long as the player remains in the room the program will repeatedly display the above menu options (using a loop) after each time that the user enters a selection.
Pantry description
As shown in the above map the player can freely pass between the entrance and the pantry. When the player is in the pantry, the game will display the list of possible actions:
- Turn the silver lock to the left position
- Turn the silver lock to the right position
- Turn the silver lock to the center position
- Don't change the position! Return to entranceway
The program must show the current position of the lock e.g. "The silver lock is currently set to the right position.". The starting default is the 'left' position. (The unlocked position is 'right'). Similar to the entrance if the player enters an invalid selection in the pantry, a suitable helpful error message should be displayed and the list of options for the pantry will be shown again. As long as the player remains in the room the program will repeatedly display the above menu options (using a loop) after each time the user enters a selection.
Kitchen description
As shown in the above map the player can freely pass between the entrance and the kitchen. When the player is in the kitchen, the game will display the list of possible actions:
- Turn the gold lock to the left position
- Turn the gold lock to the right position
- Turn the gold lock to the center position
- Don't change the position! Return to entranceway
The program must show the current lock position e.g. "The gold lock is currently set to the center position." The starting default is the 'center' position. (The unlocked position is 'left'. Similar to the entrance if the player enters an invalid selection in the kitchen, a suitable helpful error message should be displayed and then the list of options for the kitchen will be shown again. As long as the player remains in the room the program will repeatedly display the above menu options (using a loop) after each time that the user enters a selection.
In addition to grading on whether the above functionality was correctly implemented TAs will also look at style and documentation.
Yes do it this way! No. Not this way! LEFT = 0
RIGHT = 1
CENTER = 2
if (silverLockPosition == RIGHT):if (silverLockPosition == 0): #What does 0 stand for???
You are to submit your assignment using D2L [help link]. Make sure that you [check the contents of your submitted files] (e.g., is the file okay or was it corrupted, is it the correct version etc.). It's your responsibility to do this! (Make sure that you submit your assignment with enough time before it comes due for you to do a check). If don't check and there were problems with the submission then you should not expect that you can "learn your lesson" and simply resubmit.
Submission received: |
On time |
Hours late : >0 and <=24 |
Hours late: >24 and <=48 |
Hours late: >48 and <=72 |
Hours late: >72 and <=96 |
Hours late: >96 |
Penalty: |
None |
-1 GPA |
-2 GPA |
-3 GPA |
-4 GPA |
No credit (not accepted) |
Assignments must reflect individual work; group work is not allowed in this class nor can you copy the work of others. Some "do nots" for your solution: don't publically post it, don't email it out, don't show it to other students. For more detailed information as to what constitutes academic misconduct (i.e., cheating) for this course please read the following [link].
Unless otherwise told you are to write the code yourself and not use any pre-created functions (or methods). For most assignments the usual acceptable functions include: print(), input() and the 'conversion' functions such as int(), float(), str(). Look at the particular assignment description for a list of other functions/methods that you are allowed to use and still get credit in an assignment submission. If it's not listed then you should assume that you won't be able use the function and still be awarded credit.