VI SOLVES MAZE (and lies about it)
Ivan Batinic
ivan at megatest.UUCP
Thu Jan 17 09:04:40 AEST 1991
First of all, the maze program does infact compile on a sun/3
under SunOS 3.5; if one manually cb's the source, one sees the pgm:
char*M,A,Z,E=40,J[80],T[3];
main(C){
for(M=J+E,*J=A=scanf("%d",&C); --E;J[E] = M[E] = E)
printf("._");
for(;(A -= Z = !Z) || (printf("\n|"), A = 39 ,C--); Z || printf (T))
T[Z] = Z[A - (E = A[J - Z]) && !C & A == M[A] | 6 << 11 <
rand()|| !C &!Z ? J[M[E] = M[A]] = E,
J[M[A] = A - Z] = A, "_." : " |"];
}
The above is pure 'C'onfusion to hide the simplicity of the
pgm. If you run it, and give it an integer input, it prints n times:
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
|_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._|
|
But the real joke that seems to be escaping some of you is the
original form of the source:
char*M,A,Z,E=40,J[80],T[3];main(C){for(M=J+E,*J=A=scanf("%d",&
C) ;-- E;J [E ]=M
[E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|"
) , A = 39 ,C --
) ; Z || printf (T ))T[Z]=Z[A-(E =A[J-Z])&&!C
& A == M[ A]
|6<<11<rand()||!C&!Z?J[M[E]=M[A]]=E,J[M[A]=A-Z]=A,"_.":" |"];}
Which forms a maze if you look far away and squint your eyes.
Therefore, the poster was not lying, it is a "Maze C-Program" in the
truest possible way:
a) It attempts to print a maze
b) It looks like a maze in source
c) Parsing the source is like solving a maze
A true Maze program in form, structure and functionality -- Congrats
to the author. I don't know who started this 'thread' on a source
newsgroup, but do I win a prize?
Ivan
--
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Email: {sun,decwrl,fortune,pyramid}!megatest!ivan
Disclaimer: All opinions expressed herein are my own, do not necessarily
reflect those of my employer, and, are quite possibly worthless.
More information about the Alt.sources
mailing list