The challenge of this level is to use any coding construct and pattern you like!
For your final while loops challenge, toggle open all of the closed switches and collect the gems. Choose from your existing skills to solve the puzzle.
Remember, it's okay if you don't get it on your first try! Professional coders hardly ever get things right the first time around. Your goal is to write some code and keep tweaking it until it works. Good luck!

Hint: Find your way to the gem while toggling all of the closed switches. Figure out which of the skills you've learned will work best to accomplish this goal.
The solution for this level is shown below:
Outstanding solution! Take a second to celebrate, you've just completed while loops! Your concentration and effort are paying off. Now it's time to learn about algorithms.
Next lesson is introduction to algorithms.
For your final while loops challenge, toggle open all of the closed switches and collect the gems. Choose from your existing skills to solve the puzzle.
Remember, it's okay if you don't get it on your first try! Professional coders hardly ever get things right the first time around. Your goal is to write some code and keep tweaking it until it works. Good luck!
Hint: Find your way to the gem while toggling all of the closed switches. Figure out which of the skills you've learned will work best to accomplish this goal.
The solution for this level is shown below:
Code:
while !isBlocked { while !isBlocked{ moveForward() if isOnClosedSwitch { toggleSwitch() } } turnRight if isOnGem { collectGem() } }
Next lesson is introduction to algorithms.
Comment