[algogeeks] Re: Generating mazes

2013-02-11 Thread Don
I think that your method would work if you only put an opening on 3 of the four arms of the "plus". Don On Feb 8, 9:55 pm, Anup Ghatage wrote: > Hm. Then a way to look at it is like this: > > Find a way. Find n-1 other ways which are not the solution. > > You can use a random path generating

Re: [algogeeks] Re: Generating mazes

2013-02-08 Thread Anup Ghatage
Hm. Then a way to look at it is like this: Find a way. Find n-1 other ways which are not the solution. You can use a random path generating algorithm, starting from one side, selecting a random cell from the possible 8 cell neighborhood, and then repeating the process till you get to the end.

[algogeeks] Re: Generating mazes

2013-02-07 Thread Don
I believe that this will generate a maze with multiple cycles, which violates the requirement stated in the initial question that the maze have exactly one solution. On Feb 6, 11:53 am, Anup Ghatage wrote: > There is another algorithm.. The one which involves random division. > > Basically, given

Re: [algogeeks] Re: Generating mazes

2013-02-06 Thread Anup Ghatage
There is another algorithm.. The one which involves random division. Basically, given an M x N matrix |...| |...| |...| |...

[algogeeks] Re: Generating mazes

2013-01-30 Thread Don
It is George Marsaglia's multiply with carry pseudo-random number generator. It has a period of 2^32, which is long enough for this purpose. It is about as good as a 32-bit rng can be. In real life I use the Mersenne Twister, but I wanted something simple to include here. Don On Jan 29, 11:46 pm,

Re: [algogeeks] Re: Generating mazes

2013-01-29 Thread Piyush Grover
@Don can you give the logic of your rnd() function? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options,

[algogeeks] Re: Generating mazes

2013-01-29 Thread Don
A few years ago one of my winning entries in the International Obfuscated C Code Contest generated and let the user solve a 3D maze. The program below is not obfuscated, and it only generates a 2D maze, but it illustrates the principle. The idea is to start with a solid area of wall and then tunnel

[algogeeks] Re: Generating mazes

2013-01-29 Thread Don
A few years ago one of my winning entries in the International Obfuscated C Code Contest generated and let the user solve a 3D maze. The program below is not obfuscated, and it only generates a 2D maze, but it illustrates the principle. The idea is to start with a solid area of wall and then tunnel