From: botp Date: 2011-09-04T14:17:58+09:00 Subject: Re: Beginner needing help - Writing right-angle triangle program On Sun, Sep 4, 2011 at 12:23 PM, Kane Williams wrote: > ghci> let rightTriangles' = [ (a,b,c) | c <- [1..10], b <- [1..c], a <- > [1..b], a^2 + b^2 == c^2, a+b+c == 24] > ghci> rightTriangles' > [(6,8,10)] try, (1..10).to_a.permutation(3).select{|a,b,c| a+b+c==24 && a**2+b**2==c**2} #=> [[6, 8, 10], [8, 6, 10]] kind regards -botp