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,

#include<stdio.h>
main()
{
int a,b,c;
int count = 1;
for (b=c=10;a=
"- LLLLLL?, LMKC,XYZHELLO FOLKS,\
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
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);
}
Re: Intresting code 80 80

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

Re: Intresting code 80 80

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.

Re: Intresting code 80 80

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

Re: Intresting code 80 80

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

Re: Intresting code 80 80

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

Re: Intresting code 80 80

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

Re: Intresting code 80 80

Anyone interested in programs written in similar fashion can take look at here
http://www2.de.ioccc.org/years.html#2004

Re: Intresting code 80 80

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.

Re: Intresting code 80 80

i think this is an example of "obfuscated code"

perl programmers also love to do stuff like this.

Re: Intresting code 80 80

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.

#include<stdio.h>

int main ()
{
	int a , b = 0, c = 10 ;
	for ( ; a = "ECEEBDEEBDBBBDBDEB0\
			BBBBBBBBBBBBBBBBBBBBBABCBBBBBBH0\
			CFBFBFBFBDDFBI0\
			FBABCBBBBBBBBBBBBBABCBBBBBABB0\
			BFBBBBBBBBECBBBBBBBBBBBBBBC"[b++] ; ) 
		for ( ; --a > 63 ; )
			putchar ( ++c == 73? c-=63 : 32^b&1 ) ;
	return 0 ;
}
Re: Intresting code 80 80

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).

Re: Intresting code 80 80

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 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.