RosettaCodeData/Task/List-comprehensions/SuperCollider/list-comprehensions-1.sc
2023-07-01 13:44:08 -04:00

10 lines
152 B
Scala

var pyth = { |n|
all {: [x,y,z],
x <- (1..n),
y <- (x..n),
z <- (y..n),
(x**2) + (y**2) == (z**2)
}
};
pyth.(20) // example call