When I searched the web, I found an intersting program, I dont think I can explain a bit. But, I would like to share it. It displays my home country thats the most I can say about it!

Here goes,

int a,b,c;
int count = 1;
for (b=c=10;a=
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
Hq!WFs XDt!" [b+++21]; )

for(; a-- > 64 ; )
putchar ( ++c=='Z' ? c = c/ 9:33^b&1);

Recommended Answers

All 12 Replies

I have no idea what it is doing either, but it displays an interesting map.

I am Inferring something, here.

"Mythology"[5] ; is a valid c statment.

The code resides, in the memory & the constant "Mythology", resides with it.

So it will also have, a vaild address. and *("Mythology"+5) will return 'l'?

Am I right or am I worng?. Please Justify.

>>"Mythology"[5] ; is a valid c statment.
Its a do-nothing statement. char c = "Mythology"[5]; is a valid statement.

Strings are a pointer type (char * or more recently const char *), so yes you can use the subscript operator on them.

Thank you, & Is my inference right, I am asking about the memory.

I cannot make much sense out of that code. Someone enlighten us lol!

The program is not that cryptic after all.
This guy has fooled me.
I understand what the He's been doing.

And this is what I found.

1. Ascii value of ' ' is 32 & that of ! is 33.
2. c varies from 10 to 90 - totaly 80 ( no of rows in the consol )
3. Ascii value of new line is 10.
4. b & 1 will return 1 or 0. i.e., ! or ' '
5. value of a is the number of ' ' & no of !

I cant belive I wasted 30 minutes in it.

Hope you guys agree with me.

i think this is an example of "obfuscated code"

perl programmers also love to do stuff like this.

i think this is an example of "obfuscated code"

perl programmers also love to do stuff like this.

I copied the concept and wrote one on my own. here it is.


int main ()
	int a , b = 0, c = 10 ;
		for ( ; --a > 63 ; )
			putchar ( ++c == 73? c-=63 : 32^b&1 ) ;
	return 0 ;

Days spent writing what it would take any sane person only a few minutes to write.
The same goes for reading them as well.

Mildly amusing, but you're not going to learn anything profound from picking apart IOCCC entries (only that some smart programmers have WAY too much time on their hands).

Well It took me about 40 minutes to code & 30 to analyse. Semester exams are going but, 70 minutes can be spared!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.