At least for games, I am starting to lean toward the idea that humans like the simulationist approaches as "feeling right," but the abstract graph is better for the machines, and that the ability to start with one and then produce the other is where we will eventually go.
Generating Mazes
21–30 of 33 posts
Re: Generating Mazes
#22[1] https://github.com/FransFaase/MazeGen
Re: Generating Mazes
#23https://www.reddit.com/r/proceduralgeneration/comments/kxau1...
Re: Generating Mazes
#24Maze(s) triggers PTSD in me. I was asked to write a code to generate one using a 100x100 grid in an Google interview in 40 min such that it was "fair". It was for L6/L7 (IC) position. I wrote a working code and the interviewer even acknowledged that I had atleast have a working code compared to others. The actual time I had was 30 min as 10 min included upfront discussion about what "fair" means and some time after-t…
what definition of "fair" was reached upon?
1. Only one solution (or path in this case) should exist
2. No loops (meaning the valid solution does not cross it-self)
3. The length of false path from correct path should not be more than 4
Re: Generating Mazes
#25With my 1988 IOCCC entry char*M,A,Z,E=40,J[40],T[40];main(C){for(*J=A=scanf(M="%d",&C); -- E; J[ E] =T [E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|" ) , A = 39 ,C -- ) ; Z || printf (M ))M[Z]=Z[A-(E =A[J-Z])&&!C & A == T[ A] |6 discussed in more detail in Don Libes' "Obfuscated C and Other Mysteries" [1], I turned out to have rediscovered Eller's algorithm, which only keeps one line of the maze in memory. [1…
Re: Generating Mazes
#26With my 1988 IOCCC entry char*M,A,Z,E=40,J[40],T[40];main(C){for(*J=A=scanf(M="%d",&C); -- E; J[ E] =T [E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|" ) , A = 39 ,C -- ) ; Z || printf (M ))M[Z]=Z[A-(E =A[J-Z])&&!C & A == T[ A] |6 discussed in more detail in Don Libes' "Obfuscated C and Other Mysteries" [1], I turned out to have rediscovered Eller's algorithm, which only keeps one line of the maze in memory. [1…
This segfaults for me somehow.
Re: Generating Mazes
#27mike bostock did this fantastic visualization of maze generation algorithms a few years ago, including wilson's algorithm but not aldous–broder: https://bost.ocks.org/mike/algorithms/#maze-generation i wrote a minimal roguelike a couple of weeks ago in forth: http://canonical.org/~kragen/sw/dev3/wmaze.fs (2-minute asciicast at https://asciinema.org/a/672405 , or you can run it in gforth) and tried to generate the lev…
>> however, in rogue, and in wmaze, walls occupy a whole grid cell. I think I know what you mean and I had the same kind of problem: pretty much evey maze-generation algorithm assumes the map is initially a grid of cells with four walls and proceeds by removing those walls one-by-one, systematically. The problem you had, and that I had in my project, is that your grid is made up of single characters, say like this: ■…
i'm pretty comfortable with prolog, and i'll take a look at your code later :)
Re: Generating Mazes
#28Earlier quoted context omitted.
>> however, in rogue, and in wmaze, walls occupy a whole grid cell. I think I know what you mean and I had the same kind of problem: pretty much evey maze-generation algorithm assumes the map is initially a grid of cells with four walls and proceeds by removing those walls one-by-one, systematically. The problem you had, and that I had in my project, is that your grid is made up of single characters, say like this: ■…
this is awesome! and the maze it produced looks great! yeah, the halving-dimensions thing is a form of what i did in the golang thing i linked i'm pretty comfortable with prolog, and i'll take a look at your code later :)
Re: Generating Mazes
#29Re: Generating Mazes
#30Read “How to create a maze with JavaScript“ by Nicky Reinert on Medium: https://medium.com/swlh/how-to-create-a-maze-with-javascript...