Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fibs in C

Name: Anonymous 2008-06-14 10:50

How can you write the Haskell fibs in C? I mean the

fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

fibs.

Name: Anonymous 2008-06-16 15:40

>>38
This is why I hate programming -- you do something small and get big effects. Where's the logic in this?

Name: Anonymous 2008-06-16 17:40

>>39
static fibs[2] = {0, 1};
fibs = realloc(fibs, i)
What compiler supports this kind of absurdity?

>>41
It's pretty obvious if you understand what the code is doing, which isn't hard at all in >>12,38's case.

Name: Anonymous 2008-06-16 18:24

>>42
wow, i didn't think anyone here would notice that. i guess i'm not the only person on /prog/ who actually knows c.
it's trivial to fix if you know why it doesn't work.

Name: Anonymous 2008-06-16 18:37


?- dynamic fib/2
fib(0,0).
fib(1,1).
fib(N,A):- N > 0, N1 is N-1, N2 is N-2, fib(N1,A1),
           fib(N2,A2), A is A1 + A2, asserta(fib(N,A)).

Name: Anonymous 2008-06-16 18:58

>>43
i guess i'm not the only person on /prog/ who actually knows c.
lol

Name: Anonymous 2008-06-16 21:55

>>43
There's 15 people on /prog/ and, from what I've seen, at least 6 of us know C.

Name: Anonymous 2008-06-16 22:43

fib = [ x | x=a+b, (a,b) <- fibs]

Name: Anonymous 2008-06-16 22:54

>>46
15? That's a rather estimate.

Name: Anonymous 2008-06-16 23:01

>>48
A rather estimate indeed. I'm convinced that no more than 3 different posters actually visit this board.

Name: Anonymous 2008-06-16 23:21

>>49
Well, obviously. You, me and the Sussman.

Name: Anonymous 2008-06-16 23:42

>>50
Wait, I'm neither you nor the other guy.

OH SHI-

I'M THE FUCKING SUSSMAN!

Name: GJS !!aWqau2KjG0OkKV7 2008-06-17 1:12

I am the real SUSSMAN

Name: Anonymous 2008-06-17 8:53

Email this thread to GJS immediately.

Name: Anonymous 2008-06-17 8:55

Emailing /prog/ threads to GJS is unscientific and ultimately destructive.

Name: Anonymous 2009-08-16 23:17

Lain.

Name: Anonymous 2009-08-16 23:27

Lain.

Name: Anonymous 2010-12-17 1:37

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Sgt.Kabukiman 2012-05-24 6:06

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Name: bampu pantsu 2012-05-29 3:50

bampu pantsu

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List