Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Geekiest sig ever

Author
Message
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 13th Oct 2006 23:38 Edited at: 14th Oct 2006 04:42
I got an email from someone who had this as his sig:

Quote: "
int f,r,a,c,t,A,l=42;while(--l>-42)for(t=-60;t++<20;putchar(74-f))
for(A=r=f=0;++f<42&&r*r+A*A<7056;c=r+t,a=l+A,r=(c*c-a*a)/42,A=c*a/21);
"


When I compiled it and ran it, I was pretty amazed. Genius! If anyone wants a screenie I'll whip it up.

EDIT:

I removed the main function. Just copy and paste this into a console program's main function and it should work.

Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 13th Oct 2006 23:42
lol Screen please?

I'm back! Great to be back | Watch out for one of my projects soon that will be finished
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 13th Oct 2006 23:51 Edited at: 13th Oct 2006 23:52
This is the output Cool eh?



OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 13th Oct 2006 23:57
Its pretty dodgy C - main() should have 2 arguments and return an integer...

Visit my web site for real bangin' stuff. Word.
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 14th Oct 2006 00:08
Quote: "Its pretty dodgy C - main() should have 2 arguments and return an integer..."


Bah, you're no fun no more.

I have vague plans for World Domination
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 14th Oct 2006 00:17
Not the mandelbrot!! Noooooooooooo!

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 14th Oct 2006 00:18
Quote: "Its pretty dodgy C - main() should have 2 arguments and return an integer..."


No, main does not need to explicitly have 2 arguments, and it doesn't need to return an integer. How is that dodgy?

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Oct 2006 00:23 Edited at: 14th Oct 2006 00:24
Yes, it should, otherwise it is quite possible the exiting code will generate errors when the program finishes. Without the parameters it doesn't conform to standard C.

See http://www.research.att.com/~bs/bs_faq2.html#void-main

The most important bit is it MUST return int.

Visit my web site for real bangin' stuff. Word.
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 14th Oct 2006 00:24
Quote: "Yes, it should, otherwise it is quite possible the exiting code will generate errors when the program finishes. Without the parameters it doesn't conform to standard C."

Now that's just being anal about being a geek.

"We make the worst games in the universe..."
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Oct 2006 00:26 Edited at: 14th Oct 2006 00:39
Now, if the code was C++, then main() would be fairly okay - however, as the code is C, its not...

Quote: "Now that's just being anal about being a geek."

Oh yes... Indeed. Indeedly do...

Visit my web site for real bangin' stuff. Word.
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 14th Oct 2006 00:40
Wait, how do you know it's C? From the putchar() function?

Michael S
18
Years of Service
User Offline
Joined: 2nd Apr 2006
Location: Why do you ask?
Posted: 14th Oct 2006 00:41 Edited at: 14th Oct 2006 00:52
so whats wrong with it? it dosent look right.

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Oct 2006 00:43 Edited at: 14th Oct 2006 00:45
One way. The other way, is that for some sloppy reason, C++ programmers tend to do :

for (int a=1; a<55; a++). The would also use std::out and/or std::in.

Whereas, C programmers do it like :

int a;

for (a=11; a<55; a++)

(Which is rather more readable.)

I just wanted to make sure I was the one who put in the geekest reply ever.

Visit my web site for real bangin' stuff. Word.
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 14th Oct 2006 00:55 Edited at: 14th Oct 2006 00:57
You win

EDIT:

Okay, to make things clearer, I removed the main() function part of the code. Just copy and paste it into any old C++ console program's main function and it should work

mm0zct
20
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 14th Oct 2006 01:39 Edited at: 14th Oct 2006 01:55
he missed a bracket

int f,r,a,c,t,A,l=42;while(--l>-42)for(t=-60;t++<20;putchar(74-f))
for(A=r=f=0;++f<42&&r*r+A*A<7056;c=r+t,a=l+A,r=(c*c-a*a)/42,A=c*a/21;

should be

int f,r,a,c,t,A,l=42;while(--l>-42)for(t=-60;t++<20;putchar(74-f))
for(A=r=f=0;++f<42&&r*r+A*A<7056;c=r+t,a=l+A,r=(c*c-a*a)/42,A=c*a/21);

still very cool though

notice fractal appears in partially the coding in reverse "-l>-42)f" fract backwards? f 2 4 < l- .. or am i thinking too much about this lol

AMD athlon 64 3000+, 1GB ddr400, 400GB total hdd, ati radeon x700pro 256mb (pci-e) 17" tft(@1280x1024).
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 14th Oct 2006 02:04
hehe pretty interesting mandelbrot. I have been working with fractals a bit lately, trying to get some fractal lightning. I have seen a bunch of stuff done with POV and fractals. Anyone have any code for generating 2d/3d fractal lightning (I don't care what language)?

"We are what we repeatedly do. Excellence, therefore, is not an act, but a habit." - Aristotle
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 14th Oct 2006 04:42
Quote: "he missed a bracket "


No, I took that out by accident when I removed the main() call.

Login to post a reply

Server time is: 2024-11-17 17:51:51
Your offset time is: 2024-11-17 17:51:51