Planning for a complex program (ZigZagLakes)

  1. Problem Description: Read the problem carefully, is anything ambiguous? unclear?
    1. Does the position of the first flower change on any of the islands?
    2. Does the position of the first net change on any of the islands?
    3. Will the second Jeroo always have enough flowers to break through all the nets?
  2. Analysis: Look at the islands and be sure you understand where everything ends up when the program runs for each different island. Mark:
    1. Where do the Jeroos start? (mark a 1 and 2 on each map)
    2. Where will Jeroo #1 end up after picking the flowers? (mark F on each map)
    3. After giving flowers? (mark G on each map)
    4. Where will #2 end up? (mark N on each map)
    5. How will the islands have changed?
    6. Which way will each Jeroo be facing when it's ready to dance its celebration?

    lake1 lake2 lake3
  3. Break the problem description down into sections: (high level algorithm)
  4. Break the large parts into more detailed parts
    pickFlowers giveFlowers disableNets dance
    1. do you need to find the flowers first?
    2. keep doing this:
    3. pick a row
    4. decide which way to turn
    1. do you need to find the other jeroo first?
    2. keep giving flowers as long as the first jeroo still has some
    1. do you need to find the nets first?
    2. keep doing this:
    3. pick a row
    4. decide which way to turn or if you should hop ahead
    1. do you need to know which way each Jeroo will be facing?
    2. Turn 4 times
    3. how can the same method work for both Jeroos without repeated code?
  5. Have you solved some of these before? Can some methods be used for both Jeroos? Should some methods be broken up into smaller methods?