News for hackers. Stuff that matters.
Re:Why 37signals Doesn't Hire Programmers Based on Brainteasers by edw519 on Thursday January 05, 2012 @11:14AM (#3429181)
Funny, every time I read "puzzle" or "brainteaser", I think, "I don't know why manhole covers are round," or "Who gives a shit that it took 7.612 seconds for my program to identify the 78,498 prime numbers less that 1,000,000." (Yes I know, get a life.)

But every time I read "FizzBuzz", I drop everything and go back to refactor my latest version, aspiring to get it down to one conditional.

Re:Why 37signals Doesn't Hire Programmers Based on Brainteasers by dpritchett on Thursday January 05, 2012 @11:57AM (#3429381)

    >> (1..100).each { |n| puts `curl -s fizzy.heroku.com/#{n}` }
Re:Why 37signals Doesn't Hire Programmers Based on Brainteasers by skrebbel on Thursday January 05, 2012 @12:59PM (#3429686)
win!
Re:Why 37signals Doesn't Hire Programmers Based on Brainteasers by enceladus on Thursday January 05, 2012 @02:27PM (#3430062)
Thank you for inspiring me!

I revisited my FizzBuzz just now and threw together this obscene Python one-liner.

(If I write this kind of code in production, I should be a guaranteed "no-hire"!)

    from itertools import chain, combinations
    fizzbuzz = lambda n,terms: ((lambda d: d.update((x%d,w) for d,w in sorted(reduce(lambda (d0,w0),(d1,w1):(d0*d1,w0+w1),sorted(x)) for x in chain(*(combinations(terms.iteritems(),s) for s in xrange(1,len(terms)+1))))) or d)({0:str(x)})[0] for x in xrange(1,n))

    print ', '.join(fizzbuzz(100,{3:'fizz',5:'buzz'}))
Re:Why 37signals Doesn't Hire Programmers Based on Brainteasers by talmand on Thursday January 05, 2012 @02:36PM (#3430107)
I know why manhole covers are round and if that's the reason I got the job I don't know if I'd be happy with that.

After all this FizzBuzzing I guess I should start writing one up just so I can say I've done it.