10 lines
152 B
Scala
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
|