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

Variations on a Theme

Name: Anonymous 2009-11-04 1:17

Come up with variations of your favorite toy problems.  The more obfuscated the better.

I'll start with a simple one:

def factorial(n): return reduce(lambda x,y: x*y, range(1,n
+1)) if n > 1 else 1

Name: Anonymous 2009-11-04 18:20

Not long ago I've written this
def lenY(sequence):
    return (lambda le : (lambda cc: le(lambda x: cc(cc)(x)))(lambda cc: le(lambda x: cc(cc)(x))))(
            lambda cont: lambda (s, acc): acc if not s else cont((s[1:], acc + 1)))(
            (sequence, 0))

And then decided to abandon programming forever, for I will never be able to surpass this creation of mine.

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