1. Homepage
  2. Programming
  3. CSSE1001/CSSE7030 Introduction to Software Engineering - Assignment 2: Garden Gnome

CSSE1001/CSSE7030 Introduction to Software Engineering - Assignment 2: Garden Gnome

Contact Us On WeChat
Garden GnomePythonAustraliaUniversity of QueenslandCSSE1001CSSE7030Introduction to Software Engineering

1 Introduction CourseNana.COM

Garden Gnome is a single-player simulator game where a player must take care of house plants for 15 days. The player must keep more than half their plants alive for this duration. Items are be rewarded throughout the days to assist the player, and are applied when needed. See Figure 1 for a sample game. CourseNana.COM

In Assignment 2, you will create an extensible object-oriented implementation of Garden Gnome which employs a text-based interface. CourseNana.COM

You are required to implement a collection of classes and methods as specified in Section 5 of this document. Your program’s output must match the expected output exactly; minor differences in output (such as white-space or casing) will cause tests to fail, resulting in zero marks for that test. Any changes to this document will be listed in a changelog at the end of the document. CourseNana.COM

Figure 1: A snippet from a functional game of Garden Gnome. Each room in the house is separated by walls (represented by #) and each room can have four plants eac represented by a single character. CourseNana.COM

2 Getting Started CourseNana.COM

Download a2.zip from Blackboard — this archive contains the necessary files to start this assignment. CourseNana.COM

Once extracted, the a2.zip archive will provide the following files/directories: CourseNana.COM

a2.py CourseNana.COM

The game engine. This is the only file you submit and modify. Do not make changes to any other files. CourseNana.COM

a2_support.py CourseNana.COM

Provided classes implementing functionality to render the text interface. CourseNana.COM

constants.py CourseNana.COM

Constants you may find helpful when writing your assignment. houses CourseNana.COM

A folder containing several text files of playable houses. CourseNana.COM

example_simulations CourseNana.COM

A folder containing example output from running the completed assignment. CourseNana.COM

3 Gameplay CourseNana.COM

The objective is to have more than half the plants alive at day 15. For example, if the game started with ten plants, six plants are required to be alive at day 15 to win the game. CourseNana.COM

Gameplay occurs according to the following steps: CourseNana.COM

  1. Prompt user with “Enter house file: ”. Presume the file exists at the location

given relative to where a2.py is saved. For instance, houses/house1.txt. CourseNana.COM

  1. Display house and prompt user with “Enter a move: ”. The list of valid moves

are given below. Assume invalid moves may be entered, but ignore them. CourseNana.COM

  1. Progress to next day when n is entered.
  2. Break on lose or win, otherwise go to step 2.

3 CourseNana.COM


Figure 2: All available moves. CourseNana.COM

3.1 Room and position system CourseNana.COM

The room and position system used for the simulator is depicted in Figure 4. For example in the “Balcony” room there are always four possible positions to place plants, 0, 1, 2, and 3, from left to right, each room has 4 columns at different elevations. Positions are represented as a single int. Note that this is just an example; you must not assume that you will always have a Balcony room. CourseNana.COM

4 Class overview and relationships CourseNana.COM

• Hollow-arrowheads indicate inheritance (i.e. the “is-a” relationship).
• Dotted arrows indicates
composition (i.e. the “has-a” relationship). An arrow arrow marked with −→ denotes that each instance of the class at the base of CourseNana.COM

5 Implementation CourseNana.COM

5.1 Model classes CourseNana.COM

This section outlines the model classes you must implement, along with their required methods. The classes are laid out in the order in which it is recommended you attempt them (with some exceptions that are discussed in the relevant sections). It is strongly recommended that you ensure a class is working via testing the implementation yourself before moving on to another class (particularly if that class is a superclass of the next class you will attempt). CourseNana.COM


Entity CourseNana.COM

(abstract class) CourseNana.COM

Abstract base class for any entity. Provides base functionality for all entities in the game. CourseNana.COM

get_class_name(self) -> str (method) Return the class name of this entity’s class. CourseNana.COM

get_id(self) -> str (method) Return the single character id of this entity’s class. See constants.py for the ID CourseNana.COM

value of all tiles and entities. CourseNana.COM

__str__(self) -> str (method) Return the string representation for this Entity. CourseNana.COM

__repr__(self) -> str (method) Return the text that would be required to make a new instance of this class that CourseNana.COM

Plant (class) Inherits from Entity CourseNana.COM

Plant is an Entity that is planted by the user. A plant has water and health points 7 CourseNana.COM

(HP) which start at 10, age starting at 0, and no repellent. A plant’s drink rate and sun level are determined by the name of the plant See constants.py for the drink rate and sun level of all plants. CourseNana.COM

__init__(self, name: str) -> None (method) Setup the plant with a given plant name. See constants.py for the plant names. CourseNana.COM

Item (abstract class) CourseNana.COM

Inherits from Entity CourseNana.COM

Abstract subclass of Entity which provides base functionality for all items in the game. CourseNana.COM

apply(self, plant: Plant) -> None (abstract method) Applies the items effect, if any, to the given plant. Raise NotImplementedError. CourseNana.COM

Model (class) CourseNana.COM

This is the model class that the controller uses to understand and mutate the house state. The model keeps track of multiple Room instances and an inventory. The Model class must provide the interface through which the controller can request information about the house state, and request changes to the house state. CourseNana.COM

__init__(self, house_file: str) -> None (method) CourseNana.COM

GardenSim (class) CourseNana.COM

GardenSim is the controller class, which should maintain instances of the model and view, collect user input and facilitate communication between the model and view. The methods you must implement are outlined below, but you are strongly CourseNana.COM

encouraged to implement your own helper methods where possible. CourseNana.COM

__init__(self, house_file: str, view: View)
-> None
(method) CourseNana.COM

6 Assessment and Marking Criteria CourseNana.COM

This assignment assesses course learning objectives: CourseNana.COM

  1. applyprogramconstructssuchasvariables,selection,iterationandsub-routines,
  2. apply basic object-oriented concepts such as classes, instances and methods,
  3. read and analyse code written by others,
  4. analyse a problem and design an algorithmic solution to the problem,
  5. read and analyse a design and be able to translate the design into a working program, and
  6. apply techniques for testing and debugging.

6.1 Marking Breakdown CourseNana.COM

Your total grade for this assessment piece will be a combination of your functionality and style marks. For this assignment, functionality and style have equal weighting, meaning you should be devoting at least as much time towards proper styling of your code as you do trying to make it functional. CourseNana.COM

6.2 Functionality Marking CourseNana.COM

Your program’s functionality will be marked out of a total of 50 marks. As in Assignment 1, your assignment will be put through a series of tests and your functionality mark will be proportional to the number of tests you pass. You will be given a subset
of the functionality tests before the due date for the assignment. You may receive partial marks within each class for partially working methods, or for implementing only a few classes. CourseNana.COM

6.3 Style Marking CourseNana.COM

The style of your assignment will be assessed by a tutor. Style will be marked according to the style rubric provided with the assignment. The style mark will also be out of 50. CourseNana.COM

The key consideration in marking your code style is whether the code is easy to understand. There are several aspects of code style that contribute to how easy it is to understand code. In this assignment, your code style will be assessed against the following criteria. CourseNana.COM

6.3.1 Readability
Program Structure
Layout of code makes it easier to read and follow its logic. CourseNana.COM

This includes using whitespace to highlight blocks of logic. 26 CourseNana.COM

Descriptive Identifier Names Variable, constant, function, class and method names clearly describe what they represent in the program’s logic. Do not use what
is called the
Hungarian Notation for identifiers. CourseNana.COM

6.3.4 Algorithmic Logic CourseNana.COM

Single Instance of Logic Blocks of code should not be duplicated in your program. Any code that needs to be used multiple times should be implemented as a method or function. CourseNana.COM

Variable Scope Variables should be declared locally in the method or function in which they are needed. Attributes should be declared clearly within the __init__ method. Class variables are avoided, except where they simplify program logic. Global variables should not be used. CourseNana.COM

Get Expert Help On This Assignment

Scan above qrcode with Wechat

Garden Gnome代写,Python代写,Australia代写,University of Queensland代写,CSSE1001代写,CSSE7030代写,Introduction to Software Engineering代写,Garden Gnome代编,Python代编,Australia代编,University of Queensland代编,CSSE1001代编,CSSE7030代编,Introduction to Software Engineering代编,Garden Gnome代考,Python代考,Australia代考,University of Queensland代考,CSSE1001代考,CSSE7030代考,Introduction to Software Engineering代考,Garden Gnomehelp,Pythonhelp,Australiahelp,University of Queenslandhelp,CSSE1001help,CSSE7030help,Introduction to Software Engineeringhelp,Garden Gnome作业代写,Python作业代写,Australia作业代写,University of Queensland作业代写,CSSE1001作业代写,CSSE7030作业代写,Introduction to Software Engineering作业代写,Garden Gnome编程代写,Python编程代写,Australia编程代写,University of Queensland编程代写,CSSE1001编程代写,CSSE7030编程代写,Introduction to Software Engineering编程代写,Garden Gnomeprogramming help,Pythonprogramming help,Australiaprogramming help,University of Queenslandprogramming help,CSSE1001programming help,CSSE7030programming help,Introduction to Software Engineeringprogramming help,Garden Gnomeassignment help,Pythonassignment help,Australiaassignment help,University of Queenslandassignment help,CSSE1001assignment help,CSSE7030assignment help,Introduction to Software Engineeringassignment help,Garden Gnomesolution,Pythonsolution,Australiasolution,University of Queenslandsolution,CSSE1001solution,CSSE7030solution,Introduction to Software Engineeringsolution,