Jeroo Lab 3 (Basic) - Using methods

Rewrite your old program so it uses methods.

3a. Open the Island File named IslandN.jev

Write a program to get a Jeroo from the beginning (0,0) into the house of nets at the end

The jeroo must pick up the flower on the path, toss it into a net to get through the barrier and then go into the house. Save as Lab3a

Divide the program up into 3 original jeroo methods:

  • getToFlower
  • pickAndToss
  • enterHouse
On your own - do all 3

3b. A jeroo starts out on Skinny Island on the western shore, without any flowers, and must find a way across to the eastern shore by picking the flowers and using them to break through the nets.

Create a method called disableNet to pick one flower and toss it at the net ahead..Save as disableNet


3c. Create a Jeroo anywhere on NotInARow Island

It's mission is to rearrange the flowers by picking and planting so they are all in a row. Solve the problem as efficiently as possible by using a well-constructed method. Save as InARow


before
Not-in-a-Row Island

after


3d. Create 4 Jeroos, one in each corner of RelayRaceIsland as pictured to the left. Each Jeroo starts out holding a single flower. The first Jeroo is standing on top of a flower which it picks immediately and then races forward to the next Jeroo (disabling the net along the way, of course) and passes the flower on. The second Jeroo passes the flower to the third, and the third to the fourth. When the relay is finished, the last flower should be planted in the original flower position of (0,0). There should be one well-written method that all 4 Jeroos can use to complete their leg of the race. Save as RelayRaceIsland

TOP GRADE:
TG1. Create an empty island where a jeroo plants the letters OOP (Object Oriented Programming) written twice in flowers, one directly below the other. Use methods as efficiently as possible. This means that there should be almost NO repeated lines of code. Call the program OOPMethods.

TG2. Use the disableNet method from your skinnyIsland lab 3b. to instruct a Jeroo to pick a flower and toss it at the net ahead. Use one other original method to create the most efficient solution to get Wendy across stripeIsland starting at 12,0 and ending at the eastern shore. Study the layout of the island before you start to write your code to see if you can discover a pattern that will allow you to re-use the same method over and over again to solve the problem. Call the program crossStripes.

TG3. Design a symetrical island with obstacles and a jeroo in each corner, create methods to send all the jeroos to the middle and then back to the corners again in a dance that utilizes all 6 of the jeroo action methods. Call the program yourNameOriginalDance.