Open AthenasPillow opened 2 years ago
Could you elaborate how to reproduce it? Played through it multiple times and it was fine for me.
I was able to reproduce this issue. It looks like in the case where Location is equal to m the code that should run to reset your movement variable and ask how they want to move is indented so it is in the else.
The code after the else on line 1849 looks like this:
else: print('You are standing on an empty street, with cars laying on their sides, abandoned.') print('What direction do you want to go? (West, East, or North)') movement = hi while movement != 'North' and movement != 'north' and movement != 'East' and movement != 'east' and movement != 'west' and movement != 'west': movement = input() movement = str(movement) if movement == 'North' or movement == 'north': Location = s break elif movement == 'East' or movement == 'east': Location = n break elif movement == 'West' or movement == 'west': Location = l break printblox(A,B,C,P) printblox(E,F,G,H) printblox(I,S,J,K) printblox(L,M,N,O)
But it should look more like this:
else: print('You are standing on an empty street, with cars laying on their sides, abandoned.') print('What direction do you want to go? (West, East, or North)') movement = hi while movement != 'North' and movement != 'north' and movement != 'East' and movement != 'east' and movement != 'west' and movement != 'west': movement = input() movement = str(movement) if movement == 'North' or movement == 'north': Location = s break elif movement == 'East' or movement == 'east': Location = n break elif movement == 'West' or movement == 'west': Location = l break printblox(A,B,C,P) printblox(E,F,G,H) printblox(I,S,J,K) printblox(L,M,N,O)
See how the second 'print' and setting the 'movement' and 'while' blocks are now going to run (because they aren't inside the else).
I know it happens when Location == m, but I didn't check all the other places.
What you need to do is move the block of code you want to run so it is not indented inside the 'else'.
Well that was a giant mess. It didn't preserve my formatting at all.
The code is teleporting me to random space, then getting stuck in an endless loop.