r/learnpython • u/Icy-Order2226 • 4h ago
DAY 06 OF LEARNING PYTHON STUCK IN THE MAZE PROBLEM
Day 6/100: Maze solver in Reeborg's World. Solved 3/4 test cases but hit an infinite loop on the 4th. Frustrated but didn't quit. Will retry tomorrow or move forward. Feeling the difficulty ramp but pushing through. It took me 5 hours literally will show up tomorrow to push through again any suggestions will be appreciated
3
u/Binary101010 4h ago
If you're looking for suggestions, post the problem description, your attempted solution, and what output you got when you tried to run it.
1
u/thisisappropriate 3h ago
any suggestions will be appreciated
If you show your code (see the first section of the subreddit FAQ https://www.reddit.com/r/learnpython/wiki/faq/ for how), and ideally information about the test case that infinitely looped, people can tell you why it's going in a loop or if you just want a nudge in the right direction, you can ask for that too. People who might otherwise be able to help you won't know the course you're doing and won't have access to the same test cases.
Now, I do have that course and have done it, and I assume that you've now watched the video about that endless loop and hopefully understand it? In which case, my suggestion that I can give is to take pencil and paper and draw things out. Not just with things like this which do have a form on the screen, but even writing out loops in "english" (like "this variable could be x, y or z, in this if statement, if it is x, it will do this, if it is not x and is y (elif) it will do that, if it is not x or y, it will do the other thing, so z will do the other thing") - it's a valuable skill to be able to take a puzzle and turn it into "what do I need to do to solve this" or take some code that may or may not be working and turn that into "this is what it does and I can understand that"
3
u/dowcet 4h ago
Show your code