RosettaCodeData/Task/List-comprehensions/Transd/list-comprehensions-3.transd
2023-07-01 13:44:08 -04:00

7 lines
267 B
Text

(with v (for x in Range(1 n) project<Vector<ULong>>
(for y in Range(x n) do
(for z in Range(y n)
where (== (* z z) (+ (* y y) (* x x)))
do (append @projRes Vector<ULong>([x,y,z])))))
(textout "Pythagorean triples:\n" v))
}