7 comments

[ 2.1 ms ] story [ 25.7 ms ] thread
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/

I just tried to run it and all it produces is a single line and segfault:

   ./maze 
   136789
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._     ._._._._._._._._._
   Segmentation fault (core dumped)
(comment deleted)
C has many syntactic sugar and [] operator is one of them. -> is another popular one.
Of course not, everyone knows that a[b] is equivalent to *(a+b)