Wish I was smart enough to write code like that and enter into the contest...

Look at this amazing code! "Amazing" in the sense of "wow, this is really clever", not in the sense of "you should write like that"...

int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hell\
o, world!\n",'/'/'/'));}read(j,i,p)void*i;{write(j/p+p,i---j,(int)i/(int)i);}

ioccc.org/1984/anonymous/index

Follow

@vaporeon_ i really want to know why read and write can be used in reverse like that

spoilers 

@aescling Look closely. They're defining a function read(j,i,p) that performs a write!

spoilers 

@aescling Personally I got more confused by the i["]<i;++i){--i;}"] being the condition, but no, that's perfectly valid C code that does exactly the same thing as "]<i;++i){--i;}"[i]
But honestly, that's a skill issue on my side, how could I have forgotten that...

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.