List comprehensions: Difference between revisions

Content added Content deleted
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 range(1, n) {
for x in (1 .. n) {
for y in range(x, n) {
for y in (x .. n) {
for z in range(y, n) {
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)
}
}