4 ms·
This weirdest thing has been a staple of entries in the IOCCC [1]. It is used not only to obfuscate, but also to save characters. For example, in this 1989 arbi
by tromp 2y ago
This weirdest thing has been a staple of entries in the IOCCC [1].
It is used not only to obfuscate, but also to save characters.
For example, in this 1989 arbitrary length maze generator submission
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,"_.":" |"];}
the Z[A-(E ... :" |"] expression spanning the last 3 lines saves 2 characters over the conventional alternative (A-(E ... :" |")[Z].
[1] https://www.ioccc.org/ https://www.ioccc.org/
- hbossy 2y agoI just tried to run it and all it produces is a single line and segfault: ./maze 136789 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ ._._._._._._._._._ Segmentation fault (core dumped)
- tromp 2y agoSee the compilation instructions on my webpage [1] under Section "Amazing". [1] https://tromp.github.io/pearls.html https://tromp.github.io/pearls.html