The Sarcasm

Haskell and Pythagoras

by Anonymous on Jun.08, 2010, under Programming

I’m thoroughly enjoying Haskell (and my new syntax highlighter). Here’s my solution to Problem 9:

product
  $ head
    [ [a, b, c] |
      a <- [1..1000],
      b <- [1..1000],
      c <- [1000 - a - b],
        a ^ 2 + b ^ 2 == c ^ 2,
        a + b + c == 1000 ]
:, ,

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...

Archives

All entries, chronologically...