makersacademy / problem-solving

For problem-solving during the PreCourse
6 stars 2 forks source link

chapter 6 question 3 #162

Closed jlrodney closed 6 years ago

jlrodney commented 6 years ago

Hi, Does anyone know why my program exits when I input south in the second while loop rather than change the location back to location 1. Thanks screen shot 2018-08-23 at 14 27 27

NadiaAiraf commented 6 years ago

Hey the issue you're having is due to having 2 different while loops going on. When you put south in the second while loop and it loops back up to the top then location == 1 and so the loop ends.

You should be able to do it all within just one loop

jlrodney commented 6 years ago

Yes I see! I have sorted that now. Many thanks