
22 Dec
2005
22 Dec
'05
6:03 p.m.
Greg Buchholz wrote:
You might also like to try the slightly more efficient...
pyth n = [(a,b,c) | a <- [1..n], b <- [a..n], c <- [a+1..n], a*a + b*b == c*c ]
Cool. I'm amazed that actually works. I've been writing filters upon filters in all my functions because I didn't realize you could write things like that. Cheers, Daniel. -- /\/`) http://oooauthors.org /\/_/ http://opendocumentfellowship.org /\/_/ \/_/ I am not over-weight, I am under-tall. /