Extra Credit Single Loop

 

The assignment is to pick all the flowers for the map below.

You can use 2 loops for this, but you get extra credit for doing it in a single loop.

Scroll down to see a step by step visual of how 1 student did this in a single loop.


Solution

konigs_solution1konigs_solution2konigs_solution3konigs_solution4

konigs_solution5

konigs_solution6

konigs_solution7

konigs_solution8

konigs_solution9

konigs_solution10

konigs_solution11

konigs_solution12

konigs_solution13

konigs_solution14

konigs_solution15

konigs_solution16

konigs_solution17

konigs_solution18