#πŸ”’ maze vertical walls are confusing

6 messages Β· Page 1 of 1 (latest)

raven latch
#

Hi, this is a simple maze creator and runner, my question is there is a weird thing happening with the vertical wall placement that makes it so that east and west are reversed for some reason for context:

it is supposed to make a hashmap of the walls with a key of (x, y) and a boolen values of (North, East, South, West) False for no wall and True for a wall, walls at the far end of the maze are made and then functions for wall addition

the maze starts from bottom left, with x and y being different from hline and vline (image for clearer explanation)

horizontal wall is supposed to look at the index of the line then to bulid a wall at that index and it affects North and South wall for example in the player in the pic x, y = (5, 2) the get_walls method is supposed to return = (True, False, True, False) and it works based on some tests, though didn't test on edge cases

vertical wall on the other hand in the picture at index (4, 2) it is supposed to return (False, False, False, True) West is true
but it returns (False, True, False, False), it means that East is true not west

the code contains alot of comments to check where is the problem, and the assertion is commented cause of the problem

https://paste.pythondiscord.com/ETAA

crisp ospreyBOT
#

@raven latch

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

raven latch
#

I got the solution, thanks anyways

#

!close

crisp ospreyBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.