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
6
votes
1 answer

Depth-first-search maze generation algorithm with blocks instead of walls

I am trying to implement the depth first search algorithm into my game. I have been studying this web page: http://www.mazeworks.com/mazegen/mazetut/index.htm , only to find that I wouldn't be able to use it with blocks instead of Walls. What I mean…
Xedfire
  • 157
  • 1
  • 2
  • 8
6
votes
2 answers

Maze solving optimal no left turn algorithm

I am working on a project where I need to solve a maze using the minimum number of right turns and no left turns. The distance travelled is irrelevant as long as right turns are minimized. We are asked to implement our program using both a…
mussorsky
  • 125
  • 1
  • 9
6
votes
2 answers

What kind of maze Solving Algorithm is this?

I am trying to figure out if this algorithm is A* (A-Star) Algorithm or whatever but still I am confused. Stack stack = new Stack<>(); stack.push(maze.start()); stack.peek().mark(SOLUTION_MARK); while (!stack.peek().hasMark(Cell.END)) { …
Abdelrahman Wahdan
  • 2,056
  • 4
  • 36
  • 43
6
votes
2 answers

Find Shortest Path in a Maze with Recursive Algorithm

I made a little recursive algorithm to find a solution to a maze in the following format ###S### ##___## ##_#_## #__#_## #E___## Where a '#' represents a wall, and '_' represents an open space (free to move through). 'S' represents the start…
bbedward
  • 6,368
  • 7
  • 36
  • 59
6
votes
2 answers

How to generate a maze with more than one successful path?

Which algorithm can be used to generate a maze with more than one successful path and if algorithm is modified version of some well known algorithm then explain or add a link . I am using 2D array A to store configuration of maze . Assume if the…
user3202330
  • 78
  • 1
  • 4
6
votes
4 answers

Which Procedure we can use for Maze exploration BFS or DFS

I know we can use DFS for maze exploration. But I think we can also use BFS for maze exploration. I'm little bit confused here because most of the books and articles that I've read had used DFS for this problem. What I think is that the Best Case…
6
votes
3 answers

A simple closed polygonal curve generation algorithm

I need an algorithm to generate a closed simple (no self-intersections) polygonal curve. It would make a perfect labyrinth for my game. Can you please point me to the correct keywords?
Hedin
  • 630
  • 3
  • 8
  • 19
5
votes
1 answer

Algorithm(s) for finding moving entities in a maze

A have a maze and character that's controlled by the player and a drone who has to find him (by itself). Does anyone know an (efficient) AI algorithm for doing something like this? P.S. I know there are several path finding algorithms(e.g. A*), but…
conectionist
  • 2,694
  • 6
  • 28
  • 50
5
votes
2 answers

Recursive maze solver in R

I want to solve a maze in R. I created a function inspired by corresponding Python code: Solving mazes using Python: Simple recursivity and A* search. I have a maze (i.e. a matrix), where: 0 = empty space, 1 = wall (unreachable cell), 2 = finish, 3…
tararuj4
  • 73
  • 6
5
votes
4 answers

Is there an algorithm to dynamical generate a maze, ensuring that there is always more places to go?

Let's suppose we have a maze. You start somewhere in it: * - * - * | | *-here Only a small part of the maze is generated (for example, a 10 by 10 square around you). As you move around, more of the maze is generated. Is there an…
Ruiqi Li
  • 187
  • 14
5
votes
1 answer

Best algorithm for maze solving?

I recently made a project to solve a given maze using different pathfinding algorithms. I did this by importing a black and white maze image, and making each junction a node. I tried solving this using DFS, BFS, Dijkstra and A*, but noticed that…
Sam
  • 289
  • 3
  • 11
5
votes
1 answer

Print part of a 2D list

I have to create a maze game, which receives as an input a command from the user in order to play the game. I have written the code for the maze game. What I want to modify is to only show part of the maze when it is printed to the user (after a…
MOA
  • 349
  • 1
  • 16
5
votes
1 answer

Issue with Eller's algorithm - maze generation

I'm trying to create a maze using Eller's algorithm. There's not much information on the Internet about this particular algorithm. So I have some difficulties with this algorithm, because there're some things I don't fully understand. But anyway…
sovel2
  • 405
  • 4
  • 11
5
votes
1 answer

Making a 3D maze in Java

Goal I am making a program which generates a 3D maze and am having a bit of trouble with the creation algorithm. For ease of interaction, it will be a rectangular prism with one entrance and one exit. Algorithm The problem is the actual coding of…
Ky -
  • 30,724
  • 51
  • 192
  • 308
5
votes
3 answers

Confusing Java syntax

I'm trying to convert the following code (from Wikipedia) from Java to JavaScript: /* * 3 June 2003, [[:en:User:Cyp]]: * Maze, generated by my algorithm * 24 October 2006, [[:en:User:quin]]: * Source edited for clarity * 25 January…
posfan12
  • 89
  • 5
1 2
3
72 73