Challenge problems using loops


Break Free (uses islands: breakOut1, breakOut2 and breakOut3)

A Jeroo starts out in the middle of an island at (12,12) with 4 flowers. It must use it's flowers to break out of the encircling nets to reach the outer shore of the island. The program must use loops in the solution.

Create a method called findNet() that tells a Jeroo to keep hopping until it is facing a net.

Create a method called throughNet() that tells a Jeroo to use the findNet() method to find a net and then to toss a flower at the net to disable it.

Fill out the TAG sheet when finished.

Connect-the-dots. (uses islands Dot1 and Dot2)

  • A jeroo starts out in the middle of an island at (12,12) with 999 flowers. It travels north, planting flowers as it goes until it finds a flower straight ahead. Then the Jeroo looks to the left and right to decide what to do next.
    • If there is a flower only on the right, the Jeroo turns to the left and continues planting until it runs into another flower.
    • If there is a flower only on the left, the Jeroo turns to the right and continues planting.
    • If there are flowers on both the left and right, the Jeroo stops.

Print code with GOOD STYLE. (comments, indentation, good method names)

The Net Mazes (uses islands NetMaze1 and NetMaze2)

A Jeroo starts at (0,0) in the NorthWest corner of an island, with an empty pouch, and searches for a safe path to get to the flower.

netmazes

  1. Solution must use loops and methods in an efficient solution.
  2. Code must work for NetMaze islands 1 and 2.
  3. Create your own, original NetMaze island with more turns than NetMaze2.

Show the teacher when you finish your original maze island.