List comprehensions: Difference between revisions
Content added Content deleted
Underscore (talk | contribs) (Omit Perl.) |
m (→{{header|Erlang}}: optimized, made more idiomatic in syntax.) |
||
Line 82: | Line 82: | ||
pythag(N) -> |
pythag(N) -> |
||
[ {A,B,C} || |
[ {A,B,C} || A <- lists:seq(1,N), |
||
B <- lists:seq(A,N), |
|||
C <- lists:seq(B,N), |
|||
C < |
A+B+C =< N, |
||
A+B |
A*A+B*B == C*C ]. |
||
A*A+B*B == C*C |
|||
]. |
|||
=={{header|Haskell}}== |
=={{header|Haskell}}== |