+ 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.

18th Mar 2018, 1:43 PM
Oma Falk
Oma Falk - avatar
19 Answers
+ 17
@Oma Falk , can U give an example for the challenge _ _ | _ |_ | | _ |_ | //would like 2 give it a try ... looks interesting ☺
18th Mar 2018, 8:47 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
18th Mar 2018, 6:46 PM
LukArToDo
LukArToDo - avatar
+ 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
19th Mar 2018, 7:23 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 12
@ Oma Falk, copy this thread in the new challenge section and you create a lesson 👍😉
18th Mar 2018, 8:55 AM
tooselfish
tooselfish - avatar
+ 12
ok 👍😉
18th Mar 2018, 9:31 AM
tooselfish
tooselfish - avatar
+ 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.
18th Mar 2018, 1:46 PM
Oma Falk
Oma Falk - avatar
+ 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
21st Mar 2018, 6:14 PM
D_Stark
D_Stark - avatar
+ 7
Walt .... nice! on my own computer i will create and read maze-files.
19th Mar 2018, 3:30 PM
Oma Falk
Oma Falk - avatar
+ 5
@Gaurav yes my friend! thank you!
19th Mar 2018, 7:27 AM
Oma Falk
Oma Falk - avatar
+ 5
hi Walt, what is the input?
19th Mar 2018, 3:23 PM
Oma Falk
Oma Falk - avatar
+ 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!
24th Mar 2018, 12:28 PM
Oma Falk
Oma Falk - avatar
+ 4
@fish.... wont be what SL wants. Too complicated.
18th Mar 2018, 8:59 AM
Oma Falk
Oma Falk - avatar
+ 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
19th Mar 2018, 8:52 PM
sayan chandra
sayan chandra - avatar
+ 4
###@ u can easily draw them **pen-paper** and check fr o/p authencity
19th Mar 2018, 8:56 PM
sayan chandra
sayan chandra - avatar
+ 4
Thought i would create another one of these as i enjoy making them 😊 https://code.sololearn.com/cf72HXi1x9gC/?ref=app
4th Apr 2018, 8:16 AM
D_Stark
D_Stark - avatar
+ 2
This is my contribution, like you enjoy it https://code.sololearn.com/c2zmNudq9eVa/?ref=app
19th Mar 2018, 3:18 PM
Walt
+ 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
19th Mar 2018, 3:25 PM
Walt
+ 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
29th Mar 2018, 5:18 PM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
21st Mar 2018, 4:17 PM
Elaow
Elaow - avatar