The Sarcasm

Tag: haskell

Creepiness Formula Rewrite

by Anonymous on Jun.09, 2010, under Programming

Plug in the value for x (age). This can be expressed with Haskell as the following:

f' x
  | x <= 14            = floor x - 1
  | x >= 15 && x < 60  = floor ((3 / 2) * (x ** (4 / 5)))
  | x >= 60 && x <= 80 = floor x - 20
  | otherwise          = 0
Leave a Comment :, , more...

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 Comment :, , more...

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...