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

Pages: 1-

Years of fibs, finally paid off!

Name: Anonymous 2015-05-08 16:25

For years I've been implementing fibonacci function in various ways. Recrusive. Iterative. Even logic programming.

But now it will get me a job!

https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour

Check out the third one. Now I just maybe practice the 4 other and I can get any job. Though my fibs skills are so impressive, so that's probably enough alone.

Oh and... CHECK OUT MY FIBS!

Name: Anonymous 2015-05-08 16:27

Fuck yea op, you got not only 1 but two fibs with one post.

check muh fibs also!

Name: Anonymous 2015-05-08 17:22

check muh fibs also!

Name: Anonymous 2015-05-08 19:17

I solved the last one but I think it might have taken about hour.
Should I just kill myself?

Name: Anonymous 2015-05-08 19:18

>>4
No, don't take some redditard's blog post as absolute truth.

Name: Anonymous 2015-05-08 23:23

>>1
Can I see your recrusive implementation?

Name: Cudder !cXCudderUE 2015-05-09 4:15

Lunatic mode: do them all in Asm.

Name: Anonymous 2015-05-09 14:47

>>7
Which one?

Name: Anonymous 2015-05-09 16:28

>>6
function fibonacciFactory(n) {
function fibonacci(x, y) {
if(fibs.push(x) == n) return;
fibonacci(y, x+y);
}

var fibs = [];
fibonacci(0, 1);
return fibs;
}

fibonacciFactory(100).forEach(function(fib) { console.log(fib) });

Name: Anonymous 2015-05-09 16:50

>>9
Kill yourself.

Name: Anonymous 2015-05-09 16:53

Name: Anonymous 2015-05-09 17:15

>>11
yes its a reddit post

we shouldn't have stuff thats on reddit on /prog/

Name: Anonymous 2015-05-09 17:25

I wouldn't know if it was on reddit because I don't fucking go there.

Name: Anonymous 2015-05-09 22:13

(define (problem-2 a b) (apply append (map list a b)))

Name: Anonymous 2015-05-11 12:49

>>14
I've written something similar in Haskell before, that joins two lists respecting order. I.e.
join [1, 3, 2, 6] [4, 5, 7] ==== [1, 3, 2, 4, 5, 6, 7]

-- join two lists, respecting order.
join :: (Ord a) => [a] -> [a] -> [a]
join [] y = y
join x [] = x
join a@(x:xs) b@(y:ys) = if (x < y) then x : join xs b else y : join a ys

Name: Anonymous 2015-05-11 16:43

Maybe my boss should stop with his little tree traversal problems and ask people to implement fibs.

Name: Anonymous 2015-05-14 0:44

my Int @fib := 1, 1, *+* ... *;

Done. Perl 6 sure is a beast.

Name: Anonymous 2015-05-14 1:26

>>9
Not valid C. Get this GCC shit out of here.

Name: Anonymous 2015-05-14 1:40

The following problems are ridiculously simple, but you'd be surprise to discover how many people struggle with them.

He says this, but if you look at his solution to problem 4 he says how people pointed out how his solution was wrong. Looks like he's not fit to be a Software Engineer!

Name: Anonymous 2015-05-14 1:53

>>17
"one, one, and then it's just whatever plus whatever... up to whatever."

Name: Anonymous 2015-05-14 2:13

>>17
That's insane.

Name: Anonymous 2015-05-14 2:42

>>21
It's just the opposite of reduce, called with +. And lazy, obviously. Why should it be any more verbose than reduce?

Name: Anonymous 2015-05-14 4:09

>>22
It is syntactically insane.

Name: Anonymous 2015-05-15 0:16

>>23
On what grounds?

Name: Anonymous 2015-05-15 9:11

>>17
That's one of the most unreadable piece of code I've ever seen.

Name: Anonymous 2015-05-15 11:52

>>25
life←{ ⍝ John Conway's "Game of Life".
↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ ⍝ Expression for next generation.
}

Name: Anonymous 2015-05-15 14:46

>>26
APL is alien shit. Like actual bioluminiscent alien defecation. The keyboard layout for APL looks like a controller for a stargate. But it's syntactically more sensible than Perl.

Name: Anonymous 2015-05-15 15:48

>>27
The keyboard layout for APL looks like a controller for a stargate.
Sounds awesome.

But it's syntactically more sensible than Perl.
The relationship of semantics->syntax is more saner in Perl 6 than in APL.

Name: Anonymous 2015-05-15 17:10

>>27
Damn those keyboards are expensive now.

Name: Anonymous 2015-05-15 18:35

>>29
Xmodmap + learn to touchtype

Name: Anonymous 2015-05-15 20:46

>>29
Build your own.

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