maze

Where is a good place to start with programing a random path on a grid?

非 Y 不嫁゛ 提交于 2019-12-11 08:56:46
问题 Im not sure where to start with this, Im not asking for someone else to do it for me but im not sure how to do it so if anyone can point me in the right direction that would be great, i cant find anything using google, here is what i need: I need to create a path from one side of the grid to the other, but not in the shortest in a random way, i need to make sure that if the path is parallel to another part of the path that it is atleast 2 units apart. thanks in advance 回答1: I wrote a maze

Understanding A* search

假装没事ソ 提交于 2019-12-11 06:11:39
问题 I am having some trouble understanding how A* search could be applied to a robot traversing a maze in real time . I understand how A* works but only in "pre-computed" sense (i.e. if you were to work out the whole path before attempting to traverse the maze). How would you use it to give an answer to "where to next" at every step of the maze? Or am I missing something? Thanks a lot! 回答1: Generally the robot will map out the maze as best it can, then run the pathfinding algorithm and follow the

Shortest path in a 3D maze

故事扮演 提交于 2019-12-11 02:09:13
问题 I'm trying to write a program to find the shortest path in a 3D maze using recursion. I am able to write the code that finds a random path through the maze but I'm wondering how I can modify my code in order to find the shortest path. Please note that I want to keep the recursive approach. Can someone suggest a solution? Here is a sample 2D maze: s XXXX XX X XXX Xe X One starts from s going to e . X is an obstacle and is the route. 回答1: It depends on the algorithm you are implementing. If you

Find all paths in a maze using DFS [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-11 00:35:45
问题 This question already has answers here : Find all possible paths through a maze (2 answers) Closed 2 years ago . Given a source and a destination cell in a maze, I would like to find all possible solutions to a maze using DFS. 0 represents a wall in my maze. Visualise the maze I've successfully written a program, but that gives me only one path. I've thought of all the possibilities to extend it to all paths but sadly even after being hours(2 days to be precise) at it, I was unable to come up

How to check if a possible path exist?

孤街醉人 提交于 2019-12-10 15:45:16
问题 I'm working on an experimental javascript-based game. Player has to travel to exit on a 2-dimensional tiled map. Feel free to check this fiddle and play I'm just randomly placing obstacles, but sometimes obstacles block the way between player and exit, and level becomes impossible to beat. The code below which showing how obstacles being placed in the map is not a part of actual code, I've just simplified and translated this part to English to improve intelligibility: var arrayCoordinates;

Algorithm to print to screen path(s) through a text maze

好久不见. 提交于 2019-12-10 15:16:29
问题 For my C++ assignment, I'm basically trying to search through a chunk of text in a text file (that's streamed to my vector vec ) beginning at the second top character on the left. It's for a text maze, where my program in the end is supposed to print out the characters for a path through it. An example of a maze would be like: ############### Sbcde####efebyj ####hijk#m##### #######lmi##### ############### ############### ############### ############### ############### ############### ########

JAVA - How to create my exit's maze? [closed]

时光怂恿深爱的人放手 提交于 2019-12-08 13:54:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . *I'm trying to open my RANDOM exit's maze in the right side from my maze there: Exit Maze and here is my code: private int hauteur; private int largeur; private static final int LMURET = 8; private static final int HMURET = 4; private char[][] dessinLaby; public Labyrinthe(int h, int w) //en nbre de cases { this

Reading a text file and creating a maze

萝らか妹 提交于 2019-12-08 06:09:42
问题 I am working on a program that will read a file containing information about a maze and use that information to find a path through the maze. The problem I am having is representing the maze in the array. I am not sure how to turn the X's into integers to represent them as walls in the array. In the one argument constructor I use a for loop to go through the file and put each character into the appropriate array index. The way I have done this clearly does not work and if anybody could give

Simple implementation of a maze generation method (random DFS)

空扰寡人 提交于 2019-12-08 04:37:24
问题 In an interview, my interviewer asked me this question: Develop a function to generate a random maze This is a quite difficult question to solve in 30min if you don't have solved this question before. On the internet there are many solution but none seems easy. The method should respect this constraint: it should accept the size of the maze (a square maze NxN) it should consist of only Walls and Path to make it simple, the algorithm doens't need to set the entry and the exit I will post the

how to solve theta mazes using opencv python?

最后都变了- 提交于 2019-12-08 04:26:30
问题 I have to find shortest path from the center of the maze to the outermost circle. I have to solve this problem using opencv and python 回答1: I'm out! You can consider every white pixel in the image as a node of an undirected weighted graph. Every pixel (node) is connected to it's white neighbours. The weight of the edge connecting the two nodes is 1 in horizontal and vertical direction, and sqrt(2) (or simply 1.414 ) in diagonal direction. Than, since you know starting and ending point, you