/* http://sedcore.eu.org/kronecker.c * version 2026-05-18 * * Compile like this: * gcc -std=c89 -o kronecker kronecker.c * * A little proggy to display the sierpinsky triangle on the terminal * computed using the nth Kronecker power of matrix G2 where G2 is: * | 1 0 | * G2 = | 1 1 | * * This is an easter egg found in the 3GPP document 38.212, in 5.3.1.2 * (Polar encoding). The sense of humor of those corporate people never * ceases to amaze me. * * A coding style reflecting the clarity of the 3GPP specifications has * been employed. I think it is reasonably well accomplished. * * Todo: have 'putchar' appear only once and remove '\n' and ".*", which are * obvious deviances from the goal of compliance with 3GPP clarity. That * would enlight the reader even more! */ #define N 5 main (_,__,____,___,_____,______){ return _||__!=4||!____?__>>=1,!_&&!__&& main(_,main(_,4,4,main),main)&&main(_,main(_,4,1),__,main,main)||!_&&__&2||! _&&__&1&& ____
_-_&&main(_-_,_-_)&& putchar ('\n')||!__&&(_____-______||(_____%-_||putchar('\n'))&&putchar(".*"[ ___]))||main&&!_||main(_,__,main(_,__,main(_,__,main(_,__,main,___,_____+__- __*_,______),___,_____,______),_-_, _____+__,______),___,_____-__*_,______): main(_,__,____-1,main)+main(_,__,____-5+__,main, main );}