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
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.
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
There is another algorithm.. The one which involves random division.
Basically, given an M x N matrix
|...|
|...|
|...|
|...
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,
@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,
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
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