Questions tagged [maze]

A maze is a tour puzzle in the form of a complex branching passage.

A maze is a tour puzzle in the form of a complex branching passage through which the solver must find a route. The pathways and walls in a maze are fixed, and puzzles in which the walls and paths can change during the game are categorised as tour puzzles. The Cretan labyrinth is the oldest known maze.

Technically the maze is distinguished from the labyrinth, which has a single through-route with twists and turns but without branches, and is not designed to be as difficult to navigate. In everyday speech, both maze and labyrinth denote a complex and confusing series of pathways.

1093 questions
3
votes
1 answer

Adding collision to maze walls

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…
Pthyon
  • 152
  • 10
3
votes
9 answers

Creating a Maze class in C++ using 16bit unsigned int array?

I'm attempting to make a data structure to represent a Maze in C++. All the data I need to hold about the maze can be stored in 16 bit integers using bitwise operations (to represent each cell of the maze): (source: mazeworks.com) 16 bit unsigned…
KingNestor
  • 65,976
  • 51
  • 121
  • 152
3
votes
2 answers

Non - perfect maze Generation

I have coded the A* Algorithm for a project. One of the requirements of this project is to randomly generate 50 mazes. I am a bit stuck because this is not similar to normal maze generations. In maze generations you have blocked and unblocked…
noobcoder24
  • 135
  • 1
  • 13
3
votes
1 answer

Pathfinding in JavaFX

I have created a maze game in JavaFX where a user can create their own maze and play it. The maze is built using buttons with CSS IDs depending on the 2-dimensional array the level is temporarily stored in. The problem arises with the next part of…
Barnabus
  • 33
  • 6
3
votes
1 answer

Algorithm for finding an entity in a maze without prior knowledge

I have a grid like weighted maze and I need to find the shortest path to an entity without having any prior knowledge of the maze. Algorithms like A* expect priot knowledge and 'jump' around when looking around, but that's not possible when I have…
rrebase
  • 3,349
  • 2
  • 16
  • 27
3
votes
1 answer

Validation function for not crossing the boundaries of a matrix (maze)

Assume you have programmed a m x n matrix in Python. It is not possible to have a value outside the matrix. Assume you are something that is moving in the matrix (like in a maze) and that you can't cross the boundaries. While you are moving through…
3
votes
1 answer

Generating and solving a maze with no boundaries?

Well, suppose that you try to walk across the "northern edge" of the maze, you'll come back to the same maze but at the "southern edge". Kinda like navigating through a sphere of maze. Would it be possible to generate and solve a maze like that? I…
vxs8122
  • 834
  • 2
  • 10
  • 22
3
votes
1 answer

C : Get a segmentation fault when generating random maze

I try to generate a maze randomly but I get a segmentation fault when compiling the program below Here's the code void spread(int v, int x, int y, int *t,int w, int *count){ //table of directions(Right,Down,Left,Up) int d[4][2] =…
YYY
  • 91
  • 2
  • 11
3
votes
3 answers

Finding a dictionary from its contents

I'm trying to create something to prove the concept that moving through a maze with your left hand on the wall works, so I've made a python 3.6 turtle program to do it. It's extremely inefficient, I know, I'm a beginner, but my question is; How…
Box Fan
  • 43
  • 7
3
votes
2 answers

How to call a color sprite to a certain position (Swift 3)

So within my project, I am basically trying to make a randomly generated maze with random entrances and exits. I have three classes (a Maze class, a GameScene class, and a Grid Class) within so far I have successfully been able to code a randomly…
3
votes
3 answers

Dynamic maze mutation

I have an idea of creating yet another maze game. However, there is a key difference: maze changes on-the-fly during the game. When I think of the problem the following restrictions come into my mind: there is main route in the maze which never…
baltazar
  • 1,659
  • 2
  • 18
  • 23
3
votes
1 answer

Avoiding stack overflow (Maze generator in C)

I'm currently writing a maze generator in C, using the depth-first search algorithm. It's working really well, and I'm happy with the result, but when I push the dimensions of the maze a bit too far (more than 2000x2000), it gives me a stack…
SamuelRousseaux
  • 107
  • 1
  • 1
  • 8
3
votes
0 answers

Maze generation with keys and doors

I've gone through a lot of the common maze generating algorithms but have yet to find something that might be able to help me out here. I want to create a maze with doors that you can only go through after collecting a key elsewhere in the maze. All…
Burrito
  • 31
  • 1
3
votes
1 answer

"Confused Digger" algorithm running too slow, any way to speed it up?

I have an algorithm that was based on a backtracking maze algorithm with some parts removed, resulting in this wonderful dungeon. Unfortunately, it runs extremely slowly which makes it almost impossible to fill a decently-sized map with. I really…
Alexis Dumas
  • 1,299
  • 11
  • 30
3
votes
1 answer

Generating a maze with Javascript & Canvas

I'm having a peculiar issue with a maze generation program I'm writing for my resume. I'm using canvas and the entire thing works perfectly, except it won't draw the square correctly in the end. It works by using this object template: {row:nRow, …
Naomi Dennis
  • 45
  • 1
  • 7