maze

Solving 2D maze, how to avoid runtime error for hidden test case?

Solving 2D maze, how to avoid runtime error for hidden test case? Question: There are two test cases with this problem, the first test case is shown below and the second is a hidden test case that I still can’t access. The first test case works perfectly however the second test case is showing me …

Total answers: 1

How do I prevent the player from moving through the walls in a maze?

How do I prevent the player from moving through the walls in a maze? Question: I have a maze organized in a grid. Each cell of the grid stores the information about the walls to its right and bottom neighboring cell. The player is an object of a certain size whose bounding box is known. …

Total answers: 3

what does "IndexError: index 20 is out of bounds for axis 1 with size 20"

what does "IndexError: index 20 is out of bounds for axis 1 with size 20" Question: I was working on q learning in a maze environment, However, at the initial stage, it was working fine but afterward, I was getting the following max_future_q = np.max(q_table[new_discrete_state]) IndexError: index 20 is out of bounds for axis 1 …

Total answers: 3

Path finding in 2D map with python

Path finding in 2D map with python Question: I have been given a maze in the form of a labelmap (the matrix pixel either have value 1 or 0). I cannot cross the pixels with value 0. Given a starting point (x1,y1) and an end point (x2,y2), I have to find all possible paths between …

Total answers: 1

Adding collision to maze walls

Adding collision to maze walls Question: Can someone please help me adding collision points to my sprites. I had a past code where I layered a bitmap over images but the same code does not integrate well for physically drawing lines rather than detecting where the black/grey is on an image import random import pygame …

Total answers: 1

Representing and solving a maze given an image

Representing and solving a maze given an image Question: What is the best way to represent and solve a maze given an image? Given an JPEG image (as seen above), what’s the best way to read it in, parse it into some data structure and solve the maze? My first instinct is to read the …

Total answers: 10