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

10 lines
245 B
Text

(de pythag (N)
(co 'pythag
(for X N
(for Y (range X N)
(for Z (range Y N)
(when (= (+ (* X X) (* Y Y)) (* Z Z))
(yield (list X Y Z)) ) ) ) ) ) )
(while (pythag 20)
(println @) )