Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CS-224 Object Oriented Programming and Design Methodologies: 1 Guidelines

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

CS-224 Object Oriented Programming and

Design Methodologies
Spring 2020
Assignment 2, Jan 26, 2019

1 Guidelines
You need to submit this assignment on 9th of Feb at 8pm as the next assign-
ment will be given on the same day. Some important guidelines about the
assignment are as following:

• You need to do all the assignments alone

• You will submit your assignment to LMS

• You need to follow the best programming practices as given in the


accompanying document and it is also present on LMS. Failure in doing
so will have your marks deducted.

• Submit assignment on time; late submissions will not be accepted.

• Some assignments will require you to submit multiple files. Always Zip
and send them.

• It is better to submit incomplete assignment than none at all.

• It is better to submit the work that you have done yourself than what
you have plagiarized.

• It is strongly advised that you start working on the assignment the day
you get it. Assignments WILL take time.

• Every assignment you submit should be a single zipped file containing


all the other files. Suppose your name is John Doe and your id is 0022
so the name of the submitted file should be JohnDoe0022.zip

1
• DO NOT send your assignment to your instructor, if you do I will just
mark your assignment as ZERO for not following clear instructions.

• You can be called in for Viva for any assignment that you submit

2
2 Legend of SeePlusia
Prince Lazy has been captured by an evil wizard. You are Zeldana, a female
warrior who takes it upon yourself to rescue the prince and return him to
his family. You go off on a quest through the dangerous world of SeePlusia
to search for the three mythical crystals of Objectos. Together the crystals
will give you the power to defeat the wizard and rescue Prince Lazy. The
world of SeePlusia is shown in Fig. 1. It shows the different locations in the
world. The direction of travel between locations is given by an arrow and
the number of apples required to travel from one location to other are also
shown.
The rules of the game of Legend of SeePlusia are as follows.

• You begin at Enchanted Forest on the first day with 30 apples.

• You have to save Prince Lazy who is held captive at Wizard’s Castle.

• At each location you can only go in one of four directions: north, south,
east, west.

• If a direction is not shown on the map, it’s an invalid move, e.g. north
from Marsh of the Undead. An invalid move uses up the move and
consumes one apple.

• A valid move consumes the number of apples as drawn on the arrow,


e.g. to travel from Enchanted Forest to Swamps of Despair, two apples
are consumed.

• Before rescuing the prince, you have to collect 3 Objectos crystals from
the indicated locations.

• An Objectos crystal is automaticaly retrieved when you arrive at its


location.

• Once you retrieve a crystal, it is no longer present at that location.

• If you arrive at Sands of Quick, you slowly sink into quicksand and die
and the game is Lost.

• You cannot move past Bridge of Death to Wizard’s Castle unless you
have all three crystals.

• Once you reach Wizards Castle, the Prince is rescued and the game is
Won.

3
• If you run out of food before rescuing the prince, you die of starvation
and the game is Lost.

3 Your Task
A bare-bone implementation is given in Seeplusia folder. You can move the
warrior by arrow keys, and it does some arbitrary operations to demonstrate
how to use the available functions. You have to provide the implementation of
seeplusia.cpp => makeMove (string direction) function in accordance
with the game rules given above. This function is called every time you
press an arrow-key with appropriate direction provided as argument. To
modularize the program, you should add other functions as well in the same
file, that you call in makeMove.

4 Game Status
The bottom-left corner displays the game status that shows:

• Apples: Initially it shows all the 30 apples available, as you travel


the number of apples are reduced.

• Crystals: Initially there are no crystals, but as you find one, you will
increment the nCrystalsFound, and they will be shown next to apples.

• Game State: It displays Running, Lost or Won as per game rules.

5 Available Functions/Parameters
• moveEast() : moves the warrior to East.

• moveWest() : moves the warrior to West.

• moveSouth() : moves the warrior to South.

• moveNorth() : moves the warrior to North.

• applesLeft : set it to the number of apples left.

• nCrystalsFound : set it to the number of crystals found so far.

• gameState : set it to Running, Won or Lost.

4
Figure 1: World of Seeplusia

6 Credits
This assignment is courtesy of Naveed Ejaz.

You might also like