首页 » Python辅导 » Python辅导 | Assignment 2 A Titled Goose Game

Python辅导 | Assignment 2 A Titled Goose Game

INFO1110 / COMP9001  
Goosechasers: A Titled Goose Game  
Milestone Deadline: 11:59 PM Monday, 28th October 2019 AEST (Week 12)  
Final Deadline: 11:59 PM Monday, 4th November 2019 AEST (Week 13)  
Weighting: 10% of the final assessment mark.  
You are a goose. Beautiful. Majestic. Unstoppable. In the wake of your majesty, even the most  
intense of human passions are but fleeting whispers in comparison – for not only are you a  
goose, you are the Goose: Her Excellency, Duchess Hilda von Goosensmirch the Red, Countess of  
Loch Lanore and Grandmaster of the Order of the Silver Leek. There are those, however, that  
claim to see you for what you truly are: a terror to society; an agent of chaos – an avatar of  
destruction.  
The Goosechasers, as they call themselves, belong to a nefarious order of humans (and human-  
adjacent creatures) dedicated to your capture and suppression. Thanks to an unfortunate series  
of events, you, Duchess Hilda von Goosensmirch the Red, Countess of Loch Lanore and  
Grandmaster of the Order of the Silver Leek, have been cornered by one or more of these  
Goosechasers – a scenario most sub-optimal for you and yours.  
You are, of course, a goose, and in all your wisdom and majesty, are privy to many a means of  
response to this situation. Perhaps you are feeling merciful, and simply wish to evade the  
Goosechasers until they are no longer a problem – or perhaps you have suffered their existence  
long enough, and must remind them that they have no right to encroach upon your domain.  
Picture Credits: Pixabay, Uploaded by Alexas_Fotos on June 20th, 2018.  
Overview  
Description  
For this assignment, you will write a game that simulates a wild goose chase. The player will  
control a goose – a creature – that moves from one location to another, while avoiding other  
creatures that wish to harm it. The goose may attempt to frighten other creatures into running  
away (permanently) by honking at them, though some creatures will be more difficult to frighten  
than others. If the goose is caught by another creature that it cannot frighten, the player loses. If  
the goose successfully navigates to a location that allows it to flee from the other creatures, or  
successfully frightens away all other creatures on the map, the player wins.  
Implementation details  
Your program will be written in Python 3. The only Python module that you are allowed to import  
is sys. To help you begin, a scaffold has been provided. This scaffold consists of the following  
files:  
game.py, which should contain the main body of your program.  
preprocessing.py  
creature.py  
location.py  
item.py  
creature_test.py (only relevant to final submission; see page 29 for details)  
Your entire program must be contained in these files. It is recommended that you implement the  
functions in these files to the best of your ability, and use them to help you complete the  
assignment. You may create new functions as you see fit.  
Additionally, a few sample configuration files have been given to help you start up your program.  
Help and feedback  
You are encouraged to ask questions about the assignment on the discussion board, on Ed.  
Please ensure your code is comprehensible before requesting feedback. We recommend that  
Staff may make announcements on Ed regarding any updates or clarifications to the assignment.  
You can ask questions on Ed using the assignments category. Please read this assignment  
description carefully before asking questions. Please ensure that your work is your own and you  
do not share any code or solutions with other students.  
Submission  
each submission, the marking system will automatically check your code against public test  
cases.  
These public tests do not cover all parts of the specification and your code. The complete test  
suite contains both public and hidden test cases, and your code will not be run through this suite  
until after the assignment deadline.  
Please ensure you carefully follow the assignment specification. Your program output must  
exactly match the output shown in the examples.  
Warning: Any attempts to deceive or disrupt the marking system will result in an immediate zero  
for the entire assignment. Negative marks can be assigned if you do not properly follow the  
assignment specifications, or your code is unnecessarily or deliberately obfuscated.  
Milestone  
To ensure you are making regular progress on this assignment, you must have achieved a  
minimum level of functionality in your submission by October 28th, 11:59 PM AEST (Week 12  
Monday) to receive a portion of the marks. See the Milestone Submission section at the end of this  
document for further details.  
Configuration Files  
The program will be given 4 extra command line arguments when it is run:  
$
python3 game.py <PATHS> <ITEMS> <CHASERS> <EXITS>  
These arguments (let’s call them configuration files) will be used to generate Location, Item,  
and Creature objects that you will need to run your program. The Location, Item, and Creature  
classes are to be defined in the location.py, item.py, and creature.py files, respectively, and  
the specification for these are available in the Classes section on page 6 onwards.  
Examples of these configuration files are available in the provided scaffold; check for the files  
sample_paths.txt, sample_items.txt, sample_chasers.txt, and sample_exits.txt Empty lines  
encountered in any configuration file can be safely skipped and ignored.  
If fewer than 4 arguments are supplied, print: “Usage: python3 game.py <PATHS> <ITEMS>  
<CHASERS> <EXITS>” and exit the program.  
Of the given arguments, you can expect that they will all be paths to a file (and/or the name of a  
file). If any one of the files specified by the arguments do not exist, print: “You have  
specified an invalid configuration file.” and exit the program.  
<
PATHS>  
The first argument, <PATHS>, should be the name of a file containing a list of all connections  
between Locations in the program. You can use this file to generate Location objects as defined  
on page 6. Each line is of the form:  
START > DIRECTION > DESTINATION  
Where START and DESTINATION are the names of Location objects, and DIRECTION indicates a  
direction on the compass (northwest, north, northeast, east, southeast, south, southwest, west)  
that a creature must travel towards in order to move between START and DESTINATION. For  
example:  
Lake > northeast > Trail  
Trail > SOUTH > Gazebo  
If a Creature is currently at the Lake, it can move NORTHEAST to arrive at the Trail. Similarly, if a  
Creature is currently on the Trail, it can travel SOUTH in order to arrive at the Gazebo.  
Paths do not need to be reflective – going north in location A and immediately going back south  
does not have to lead you back to location A. This is a game, so some paths might not make  
sense, and that’s ok! For example:  
Lake > NORTH > Gazebo  
Gazebo > South > Gazebo  
Location names are case sensitive, but DIRECTIONs are not.  
When the program starts, the player will begin in the FIRST room specified by this file. If an  
empty <PATHS> file is given, print: “The game cannot run without any rooms :(“ and exit the  
program.  
You can reasonably expect that any <PATHS> file we will give you will contain valid input (i.e. no  
weird lines like “Grass > Fence > More Grass” or “Not enough > arrows”.)  
<
ITEMS>  
The second argument, <ITEMS>, should be the name of a file defining all the Item objects that  
are available in-game. Each line is of the form:  
short_name | item_name | full_desc | terror_rating | location  
Most of these are explained in the description of the Item class on page 9.  
full_desc is a long description of the item which is written to a Location‘s description if the  
item exists at that location, but has not been picked up by a Creature. More information on  
this in can be found in the Location description on page 6.  
location as it implies specifies the name of a Location that the Item object will appear  
in when the game begins. You can expect that this is name will also appear somewhere in  
the <PATHS> configuration file.  
For example:  
rake | battered, old rake | A battered, old rake lies here, dreaming of lakes. | 2 |  
Garden  
It is possible for the game to start and end with no items, so it is possible that the file specified by  
<ITEMS> is empty. Should this be the case, the game should run as normal.  
<
CHASERS>  
The third argument, <CHASERS>, should be the name of a file defining all Creature objects in the  
game that are not controlled by the player. Each line of this file is of the form:  
name | description | terror_rating | location | direction  
The name of a Creature is a unique name that the program (and the user) can use to refer  
to the Creature object.  
A description of the Creature will be written to a Location‘s description if the Creature is  
in the same Location as the player.  
terror_rating describes the terror_rating that a Creature begins with at the start of the  
game. This number represents how terrifying something is – or how difficult a Creature is to  
frighten. More details about this can be found in the Creature description on page 10.  
location as it implies specifies the name of a Location that the Creature object will  
appear in when the game begins. You can expect that this is name will also appear  
somewhere in the <PATHS> configuration file.  
direction describes a movement pattern that a Creature will engage in if it is not  
controlled by the player. More on this on pages 10-12.  
An example:  
dog | A dog is barking at you! | 4 | Park | North  
As the premise of the game is not possible without any creatures to chase the player, the  
<CHASERS> file cannot be empty! If an empty <CHASERS> file is provided, print: “There is  
nothing chasing you!” and exit the program.  
<
EXITS>  
The fourth argument, <EXITS>, should be the name of a file that contains a list of Location  
names. Each of these Location objects will allow the player to use the FLEE command (page 16)  
to win the game. If a line specifies a name that does not correspond to a Location, ignore it and  
move on to the next one.  
It is possible for the <EXITS> configuration file to be empty – in that case, the player has no  
choice but to scare off all other Creatures to win!  

程序辅导定制C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持 Alipay WeChatPay PayPal等支付方式

E-mail: vipdue@outlook.com  微信号:vipnxx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank

发表评论

您的电子邮箱地址不会被公开。