+ 14
[ASSIGNMENT] Find a way through a selfmade labyrinth(maze)
Build a labyrinth - maybe a 2*2 matrix. Determine a starting point Write a algorithm to find way out. One often working algorithm is to always turn right (left) if you can add: create a labyrinth where the algo does not work.
19 Answers
+ 17
@Oma Falk ,
can U give an example for the challenge
_ _
| _ |_ |
| _ |_ |
//would like 2 give it a try ... looks interesting ☺
+ 16
//not most efficient for now , but can found through all mazes [if possible]
//It makes random maze with atleast 1 way out
https://code.sololearn.com/cHEQP6wkl3c2/?ref=app
+ 12
@ Oma Falk, copy this thread in the new challenge section and you create a lesson 👍😉
+ 12
ok 👍😉
+ 8
@Gauraw
much coding is building the maze
Shorter codes for that should be possible
https://code.sololearn.com/cU7GpsYo6Eyj
Edit: I improved coding... works pretty good now but you might find no way out for certain mazes.
+ 8
Creates a random maze at any size with pathfinder there is always 1 successful path which is random
https://code.sololearn.com/c6gPD3epfXtX/?ref=app
+ 7
Walt .... nice!
on my own computer i will create and read maze-files.
+ 5
@Gaurav
yes my friend!
thank you!
+ 5
hi Walt,
what is the input?
+ 5
I did something like this in a Minecraft-Hacking class.
The Kids created a simple .txt
file with a maze made of 'x'
A simple python prog read it and set the blocks.
For two hours the kids had fun!
+ 4
@fish.... wont be what SL wants. Too complicated.
+ 4
okay...
my algo is...
input-->
a 2D matrx of cell weights...
....
u need to decode them in order to know in which way u can move(up..down..left...right)
eg : 10 = 0+2+0+8
= 0*2^0 + 1*2^1 + 0*2^2 + 1*2^3
means...
the cell looks like...
# #
# #
# #
# #
up and down r open...
## NOT AS PER CHALLENGE WANTS I GUESS..##
https://code.sololearn.com/cIXkvQTyHRPK/?ref=app
+ 4
###@ u can easily draw them **pen-paper** and check fr o/p authencity
+ 4
Thought i would create another one of these as i enjoy making them 😊
https://code.sololearn.com/cf72HXi1x9gC/?ref=app
+ 2
This is my contribution, like you enjoy it
https://code.sololearn.com/c2zmNudq9eVa/?ref=app
+ 2
Well, you need to modify the char array for changing the path, points for a free way, and # as walls, you need to modify on the code
+ 2
Here's mine. My first C++ code
Inputs should be higher than 10 to get better mazes.
https://code.sololearn.com/cCmVctxHBXWl/?ref=app
+ 1
Random unsolved labyrinth.
https://code.sololearn.com/c8O62Ys8O54V/?ref=app