Make the island safe for all runners

There are deadly nets hiding in the center of flower arrangements on the island. The demolition team must be sent ahead to make the way safe for the runners who will be racing across the island later in the day.


First, solve the problem of disabling a single, hidden net in one flower arrangement like the ones above. Open the island disable1Center.jev and use this code to start the demolition team and the runners.

method main Jeroo methods
method main(){
   Jeroo demolishCrew = new Jeroo(6,1,10);
   Jeroo runner1 = new Jeroo(5,0);
   Jeroo runner2 = new Jeroo(6,0);
   Jeroo runner3 = new Jeroo(7,0);

mid start facing the center

top then move the crew to start in row 5

low then start in row 7

How does the code change?

// find a flower and figure out how to disable
//      the net inside
method removeNets(){
// keep going until a flower is found
//    but don't jump off the end of the island
method findFlower(){

// the jeroo is facing a flower, find the net
//   inside the flower arrangement and disable it
//   if there is only 1 flower ahead, the net is ahead
//   if there is also a flower to the left, 
//        the net is to the left
//   if there is also a flower to the right, 
//        the net is to the right
method disableNet(){

// get across the island as quickly as possible
method run(){

Now write a single method for disableNet that uses ifs to decide where the net is that you need to disable depending on where the flowers are : ahead of you, to the left or to the right. (hint: once you encounter a flower in front of you there will either be a flower to your left, or your right or only straight ahead)

Run and test the program and fill out the TAG sheet.

Now, add a loop to the removeNets method so it will remove all the nets on Disable6Centers Island and leave the way clear for the runners.