- View the video walkthrough by clicking here
-
Purpose
- To establish familiarity with conditional statements
-
Objective
- Modify the
Greepclass to collectTomatoobjects and return them to theSpaceshipwhile avoidingWaterand obstacles.
- Modify the
-
Description
- Your task is to program the
Greepto collect as manyTomatoas possible. - You may ONLY CHANGE THE GREEP class.
- You may not change any other class.
- Your task is to program the
-
Getting oriented
- Please view the javadocs for this project to get better acquainted with the object orientation
- the Creature class is the abstract superclass of the
Greepclass. - the Greep is a concrete subclass of the
Creatureclass. - the GreepSpit is a composite child of
Greep. It is the permissible only communication mechanism byGreeps. - the TomatoPile is where
Greepgather resources. AGreepcannot retrieve from aTomatoPileunless anotherGreepis there to load it onto the otherGreeppresent at the sameTomatoPile.
- the Creature class is the abstract superclass of the
- Please view the javadocs for this project to get better acquainted with the object orientation
-
Development Constraints
- Only change the class
Greep. No other classes may be modified or created. - No additional fields. You cannot extend the
Greepmemory.- you are not allowed to add fields to the class (except final fields).
- You can use the one byte memory that is provided.
- You cannot
movemore than once peractround. - You cannot communicate directly with other
Greep.- That is: no field accesses or method calls to other
Greepobjects are allowed. Greepcan communicate indirectly via theGreepSpiton the ground.
- That is: no field accesses or method calls to other
- No long vision.
- You are allowed to look at the world only at the immediate location of the Greep.
Greepare almost blind, and cannot look any further.
- No instantiating
Actorsubclasses.Actorsubclasses, such asGreeporGreepSpit, cannot be instantiated.Greephave no magic powers - they cannot create things out of nothing.
- No teleporting.
- Methods from
Actorthat cheat normal movement (such assetLocation) may not be used.
- Methods from
- Only change the class
- This application is built using the Jfoot library.
- To fork the project, click the
Forkbutton located at the top right of the project.
- Navigate to your github profile to find the newly forked repository.
- Copy the URL of the project to the clipboard.
- Clone the repository from your account into the
~/devdirectory.- if you do not have a
~/devdirectory, make one by executing the following command:mkdir ~/dev
- navigate to the
~/devdirectory by executing the following command:cd ~/dev
- clone the project by executing the following command:
git clone https://github.com/MYUSERNAME/NAMEOFPROJECT
- if you do not have a
- Ensure that the tests run upon opening the project.
- You should see
Tests Failed: 99 of 99 tests
- You should see
- from a terminal navigate to the root directory of the cloned project.
- from the root directory of the project, execute the following commands:
- add all changes
git add .
- commit changes to be pushed
git commit -m 'I have added changes'
- push changes to your repository
git push -u origin master
- add all changes
- from the browser, navigate to the forked project from your github account.
- click the
Pull Requeststab. - select
New Pull Request
