Programming
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
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 ]
