MCD4720 – Fundamentals of C++
Assignment 2 – Trimester 3, 2018
Submission guidelines
This is an individual assignment, group work is not permitted Deadline: December 8, 2018, 11:55pm
Weighting: 15% of your final mark for the unit
Submission Instructions:
A zip file containing your Visual Studio project and the associated documentation files (project plan) must be compiled and uploaded to the Moodle site. Your code MUST be submitted as a Visual Studio project to facilitate ease of assessment and feedback.
Late submission:
- ● By submitting a Special Consideration Form or visit this link: https://goo.gl/xtk6n2
- ● Or, without special consideration, you lose 5% of your mark per day that you submit late
(including weekends). Submissions will not be accepted more than 10 days late.
This means that if you got Y marks, only (0.95n )×Y will be counted where n is the number of days you submit late.
Marks: This assignment will be marked out of 50 points, and count for 10% of your total unit marks.
Plagiarism: It is an academic requirement that the work you submit be original. If there is any evidence of copying (including from online sources without proper attribution), collaboration, pasting from websites or textbooks, Zero marks may be awarded for the whole assignment, the unit or you may be suspended or excluded from your course. Monash Colleges policies on plagiarism, collusion, and cheating are available here or see this link: https://goo.gl/bs1ndF
Further Note: When you are asked to use Internet resources to answer a question, this does not mean copy-pasting text from websites. Write answers in your own words such that your understanding of the answer is evident. Acknowledge any sources by citing them.
1
Task Details:
This assignment consists of one main programming task. The purpose of this assignment is to get you comfortable with designing and implementing basic multi-class C++ programs. The task is detailed later in this assignment specification, as are the specific marks allocation.
Successful completion of the fundamentals of the task as described may obtain you up to a maximum of 80% of the total assignment marks. The last 20% of the mark will be allocated to additional functionality that you can design. This provides an opportunity for you to implement a feature of your choice and ensures that each student submission is suitably different. The additional functionality should demonstrate advanced or more complex application of principles covered to date. It need not be large amounts of work but should demonstrate a willingness to explore new and advanced concepts. You MUST detail what you have done in an accompanying “readme” file, otherwise markers may not be aware of the extra work undertaken.
The assignment must be created and submitted as a Visual Studio 2017 project. You may complete the exercises in your preferred IDE, however you should create a Visual Studio project in order to submit. Your project folder must be identified by using your name and assignment number, such as YourFirstNameLastNameA2. The entire project folder must then be zipped up into one zip file for submission. The zip file MUST be named “YourFirstNameLastNameID.zip”. This zip file must be submitted via the Moodle assignment submission page.
Explicit assessment criteria are provided, however please note you will be assessed on the following broad criteria:
- ✓ Meeting functional requirements as described in the exercise description
- ✓ Demonstrating a solid understanding of object-oriented design and C++ coding, including good
practice
- ✓ Following the unit Programming Style Guide
- ✓ Creating solutions that are as efficient and extensible as possible
NOTE! Your submitted program MUST compile and run. Any submission that does not compile will be awarded zero marks. This means you should continually compile and test your code as you do it, ensuring it compiles at every step of the way.
If you have any questions or concerns please contact your tutor as soon as possible.
2
Assignment Task: Text Adventure (Part B)
You are to complete the text adventure you started in Assignment 1 by adding in the additional interactivity and functionality of the player, and including the hazards (Wumpus, pits and bats).
Your completed Text Adventure must demonstrate the following:
- ✓ You MUST implement your program using the following classes (as a minimum, you may include more if appropriate):
- Location class: holds details of the various locations in game including a description, exits, and whether it has a hazard or not (you can call it whatever is appropriate for your game – Cavern, Cave, Room, etc.)
- Hazard class: holds details of the name, location, clue description and action if the player enters the same location (Wumpus or pit = game over, bats = moved to random location).
- ✓ The player (Hunter) must have greater functionality. At the prompt (eg: “Do you want to [M]ove, [S]hoot or [Q]uit?”), they should be able to input their selection which then triggers the correct response.
- [M]ove would ask the player to enter one of the exits listed for the current location. If a correct location is entered, the location information for the new location should then be displayed.
- [S]hoot would ask the player to enter one of the exits listed for the current location. If a correct location is entered and the player has arrows left, then the results of firing into the location should be displayed.
- ▪ If the Wumpus was in that location, the player wins the game and appropriate game over
actions are taken.
- ▪ If the Wumpus was NOT in that location, then it will randomly move to one of the exits of its
current location OR stay where it is. If it moves into the same location as the player then the
player loses and appropriate game over actions are taken.
- ▪ If the Wumpus was in that location, the player wins the game and appropriate game over
- [Q]uit would ask the player if they are sure, then if “yes” the game ends otherwise play
continues.
- Any commands permitted must be processed appropriately.
- ✓ The player now has more characteristics related to them:
- a name which is requested at the start of the game and used in the feedback given
- their location – carried over from the Part A
- they start with 5 arrows which is decreased each time they shoot one – when they run out they
have lost the game
- they start with a lantern that controls the number of move they are allowed before it runs out and
they lose the game – each action should reduce this counter by 1
- ✓ The locations in the game should have the following characteristics:
- An appropriate brief description (flavour text to make the game interesting and only needs to be 50 words or less). This would be displayed instead of “You are in Cave #1”.
- Four exits leading to connecting locations – these may be displayed as before.
- A hazard tag, if any. This would be “nothing” or “Wumpus” if it is in this location, or “pit” or “bats”
as required.
- ✓ The hazards in the game should have the following characteristics:
• A unique name, an appropriate clue description and a random location that is not the same as any other hazard or the player.
3
▪ For example: “Wumpus”, “You detect an awful smell coming from one of the exits”, location = 20
✓ The game is over when one of the following conditions is met:
- The player can only win the game when they shoot the Wumpus!
- The player loses the game when they:
▪ run out of arrows – they start with 5
▪ their lantern runs out of oil – they have no more turn left ▪ they end their turn in the same room as the Wumpus
▪ or they fall into a pit - The player should be able to QUIT the game at any time. Extra Functionality
The marking criteria indicates that you should make some individual additions to this in order to achieve the final 20% of the mark. This is up to you, however could include such features as (but is certainly not limited to):
- The player selects a Hunter skill level (eg: Rookie, Seasoned or Master) which modifies the parameters of the game, such as the number of locations (eg: easy = 15, tricky = 20, hard = 25), the length of time they have (how many turns will the lantern last?), the number of arrows they have, the number of hazards placed in the caves, what items they can buy and/or find, etc..
- The player can collect useful items to help them survive, either before the game starts (select from a “shop”) or they find them as they explore the caverns. Items such as a rope to climb out of a pit, a whistle to confuse the bats, extra oil to fill the lantern, a map of the caves, etc.
- Create a Player class to hold all the details about the player in one variable and make your programming more efficient.
- The lantern turns are randomly determined each move the player makes, such as reducing the turns by 3-5 instead of 1 per turn. Appropriate messages should be displayed when the player is getting close to running out of turns.
- The Wumpus could move one cavern after a random number of turns taken by the player, so the player has to find the Wumpus before it moves too often.
- Compass directions can be used to navigate the locations [N, S, E, W, NW, NE, SE, SW] to add to feeling of exploration. Player input would require more processing to accommodate these new commands.
- The arrows are magical crooked arrows which can be shot through 1 to 5 locations. You aim by typing FIRE and a list of 1-5 exit numbers or directions in which you want the arrow to go (FIRE N, E, S, S, W). If the arrow can’t go that way (there is no tunnel) it moves at random to the next cave. If the arrow hits the Wumpus, you win. If the arrow hits you, you lose.
- Change some of the game conditions:
- ▪ Instead of killing the Wumpus the player has to find a treasure and return to the village.
- ▪ Create several different “maps” and randomly select one at the start of the game.
- ▪ Allow the player to find a “map” during the game and print it out when they type MAP. This could
be read from a file.
You certainly do not have to implement all of the above to earn marks for extra functionality. One or two implemented well would be more than enough to demonstrate advanced or more complex application of principles covered to date.
It is up to you!
4
Assignment 2: Marking Criteria [up to 50 marks in total]
Does the program compile and run? Yes or No
• Zero marks will be awarded for a non-compiling program. Class Design [8]
- Location Class [4]
▪ Required data members and member functions
▪ Contains only aspects that relate to a “Location” (has no data members or member functionsthat are not directly related to a Location)
- Hazard Class [4]
▪ Required data members and member functions
▪ Contains only aspects that relate to an “Hazard” (has no data members or member functionsthat are not directly related to a Hazard)
Functionality [25]
- Game set up, including creating the locations and hazards and placing them in a random location, initialising the player and game variables, etc. [6]
- Appropriate game dialog and player interaction [3]
- Implementation of successful action processes [3]
- Implementation of displaying and navigating the locations [4]
- Implementation of the hazards with appropriate responses [4]
- Appropriate feedback displayed to the player [2]
- Appropriate end game conditions triggered [3]
Quality of Solution and Code [7]
- Does the program perform the functionality in an efficient and extensible manner? [2]
- Has a well-designed OO program been implemented? [3]
- Has the Programming Style Guide been followed appropriately? [2]
Extra Functionality [10]
- Does the program addition demonstrate advanced application of programming concepts [5]
- Does the program addition demonstrate functional creativity? [5]
5