Comment on Generating MazesComments−tromp2yWith 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<<27<rand()||!C&!Z?J[T[E]=T[A]]=E,J[T[A]=A-Z]=A,"_.":" |"];} 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] https://tromp.github.io/maze.html−remram2yThis segfaults for me somehow.−tromp2ySee https://tromp.github.io/pearls.html for suggested changes to make thus run with modern compilers.
Comments
With my 1988 IOCCC entry
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] https://tromp.github.io/maze.html
This segfaults for me somehow.
See https://tromp.github.io/pearls.html for suggested changes to make thus run with modern compilers.