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
9
votes
2 answers

Collision detection between rectangles (no overlap) - libgdx

I've been at this for 2-3 weeks now and I still can't manage to have a proper collision detection. I have created a maze using rectangles. I want my object (which is in a Rectangle) to stop whenever my object collides with any wall and be able to…
C.O.D.E
  • 885
  • 8
  • 19
9
votes
6 answers

Algorithm to generate a segment maze

I want to generate a maze that looks like this: That is, it consists of paths in one direction that are then connected. I have looked for an algorithm to generate mazes like this without success. Specifically, I don't want a maze like…
rlbond
  • 65,341
  • 56
  • 178
  • 228
9
votes
2 answers

Maze solving with breadth first search

Can someone please explain how could I solve a maze using breadth first search? I need to use breadth first search to find shortest path through a maze, but I am so confused. This is the pseudo code from my book: void breadth_first_search(tree T) { …
user2348201
  • 93
  • 1
  • 1
  • 3
8
votes
3 answers

Pacman maze in Java

So I'm building the pacman game in Java to teach myself game programming. I have the basic game window with the pacman sprite and the ghost sprites drawn, the pacman moves with the arrow keys, doesn't move beyond the walls of the window, etc. Now…
Ali
  • 261,656
  • 265
  • 575
  • 769
8
votes
2 answers

Maze solving with python

I am trying to make a maze solver, and it is working except that instead of the path being marked by "o" I want it to be marked with ">", "<", "v", "^" depending on the direction of the path. This is the part of the code where it solves the maze: …
aboodmufti
  • 322
  • 1
  • 2
  • 11
7
votes
5 answers

Creating a maze solving algorithm in Java

I've been assigned with the task of creating a maze solver in Java. Here's the assignment: Write an application that finds a path through a maze. The maze should be read from a file. A sample maze is shown below. O O O O O X O X X O X O O X O X…
Copernikush
  • 129
  • 1
  • 2
  • 7
7
votes
1 answer

Solving Maze c#

I want to solve a maze automatically when I run the program. My maze is like this at the beginning. 1 0 0 0 0 0 1 0 0 1 1 0 0 1 1 0 At the end it should look like this : 0 1 1 1 1 1 0 1 1 0 0 1 1 0 0 1 I have an array of 3 dimensions ( for row,…
David
  • 221
  • 3
  • 13
7
votes
2 answers

Find all possible paths through a maze

I'm trying to create a program that will traverse a randomly generated maze where 1's are open and 0's are walls. starting in the top left and ending in the bottom right. The path can go up, down, left, and right. Currently, my program gives me a…
r2333
  • 103
  • 1
  • 4
7
votes
2 answers

Best path in a grid

I have a best path problem to solve. Given a nxn grid populated with walkable tiles and non walkable tiles, I have to reach point B from point A, through the shortest path. The trick is some of the walkable tiles contain points. To be a valid…
Adrian
  • 2,028
  • 2
  • 17
  • 28
7
votes
3 answers

How could I stop from printing both sides of a wall in my ascii maze?

I've written some code that generates mazes for me. The maze consists of (n x n) cells, each cell has a boolean value to represent a wall (north, south, east west). It is working fine, and I wrote the function below to print out the maze: public…
Scorcher84
  • 423
  • 1
  • 6
  • 9
7
votes
5 answers

Maze Algorithm That generates the most difficult mazes?

I was playing around with the recursive backtracking algorithm but it always produces very easy mazes. What algorithm produces the hardest mazes to solve (please include information about braids and biased directions if appropriate)?
John
  • 325
  • 3
  • 13
6
votes
7 answers

Using a stack to traverse and solve a maze - Java

So I am trying to create a maze solver program that would solve a maze of X's and O's. What I would like to do is create a class of Points, so that I can create a 2-Dimensional array of Points which would allow printing to an output page as well as…
Copernikush
  • 129
  • 1
  • 2
  • 7
6
votes
3 answers

Algorithms for 3D Mazes

Are there algorithms to produce 3 dimensional mazes? Essentially the same as a 2D maze but the Z depth axis can be traversed? The idea is still the same though, to get from Start to End. Could backtracking still be used? Which algorithm should I use…
jmasterx
  • 52,639
  • 96
  • 311
  • 557
6
votes
2 answers

Infinite maze generating algorithm

I searched and even visited a maze-algorithm-collecting website, but nothing satisfies the following statements I require. To make it clear, I need an infinite maze generating algorithm that follows: makes a perfect maze, which is to…
Rratic
  • 123
  • 9
6
votes
1 answer

What is the algorithm for generating the maze in the game Netwalk?

What is the algorithm for generating the maze in the game Netwalk?
user235273
1
2
3
72 73