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

c++ maze solver (find every solution) stack overflow

I have an assignment to randomly generate a maze ("weird" ones are valid as well), then I have to find all solutions for the maze (a solution being finding a way from the first row or column to the last row or column), also determine the shortest…
-4
votes
1 answer

This simple python code isnt working?

Whenever an output should result in a change of shield, the program just says 'You have 5 shields' followed by 'You Win'. I think I might have made a mistake when passing over the variables from one function to the next. Thank you in advance for the…
Joseph
  • 1
  • 5
-4
votes
1 answer

Path in a maze(2-D Array)

Question: Given a maze as input alongwith the entry and exit points, find whether a path exists that leads from the entry point to the exit point. The maze is entered as char[][] with each value being either '+' or ' '(i.e. space). A '+' denotes a…
abhishek14d
  • 89
  • 2
  • 12
-4
votes
1 answer

I am having trouble writing code to solve a maze recursively (backtracking)

I looked on the internet and other places (including my book), but I don't really seem to get the answer I am looking for. The big part that has kept me up until this terrible hour (5:25 am) is backtracking. How does this even work? I just put…
Bombadil
  • 5
  • 1
  • 4
-4
votes
1 answer

BFS algorithm in mazes java

In input we have length and width of maze, and the maze that looks like A..# ##.# #B.# #### Where "#" - is wall, A- start point, B - end point. In output we should to see a length of shortest route in maze. I was reading a lot of examples of codes,…
rustock
  • 387
  • 3
  • 6
  • 12
-5
votes
1 answer

Plotting a maze diagram using matplot in python

I am trying to create the exact maze in the diagram shown with python codes and I'm having a bit of a hiccup. I'm aware that one can use matplotlib with an array of 1's and 0's to plot it out. But still I don't get it. Could someone help me out and…
-5
votes
1 answer

2D array Maze solve in C

I have an maze represented as a square array of integers. I have to find the least-cost path (sum of integers) through the maze, moving orthogonally. 12323 12323 11232 21111 For instance, the track through the maze above will be all the…
Dor
  • 1
  • 2
-5
votes
1 answer

Maze algorithm that actually works

I've been working on trying to solve mazes and output the path from start to the end. No matter what I do though, it never really works 100%. It manages to backtrack trough the whole maze like it should and find the end... but actually outputting…
Alex S
  • 3
-5
votes
4 answers

Find the x and y of a case in a maze ( in C)

I want to find the distance between case(n) and case(m), with n!=m, using A* algorithm. How can i find x0, x1, y0 and y1 by using case number, height and width in a maze ? Are there a formule for that ? float distance(Maze* maze, int start, int…
Roberto Rossi
  • 11
  • 1
  • 8
-5
votes
1 answer

problems with big matrix

I got a mission to find the shortest path in maze 10X10. I defined the size by N and try at the beginning to debug with size 3X3 and 4X4 to check step by step,and the program worked fine. After this i tried to enlarge the size and then the program…
user3205436
  • 57
  • 1
  • 8
-6
votes
1 answer

Generating a perfect maze in C

I want to be able to generate a perfect maze in a file (in C). The maze itself will be represented like such: **XX**X* X**X**** XX*X*XX* XX***XX* Meaning that the X are walls and the '*' are empty spaces (where you can move). What I have done for…
Christopher
  • 1,712
  • 2
  • 21
  • 50
-7
votes
1 answer

C# wall following algorithm, maze solving

I'm trying to implement simple algorithm in which the "player" goes up/down and left/right, until he finally reaches exit. But I have problem, that it goes to few directions a then it stucks. public override bool GetNextPosition(out int nx, out int…
John
  • 3
  • 4
1 2 3
72
73