List comprehensions: Difference between revisions
Content added Content deleted
(→ES6) |
m (→{{header|Sidef}}: minor code simplifications) |
||
Line 1,860: | Line 1,860: | ||
<lang ruby>var n = 20 |
<lang ruby>var n = 20 |
||
say gather { |
say gather { |
||
for x in |
for x in (1 .. n) { |
||
for y in |
for y in (x .. n) { |
||
for z in |
for z in (y .. n) { |
||
take([x,y,z]) if (x*x + y*y == z*z) |
take([x,y,z]) if (x*x + y*y == z*z) |
||
} |
} |