RosettaCodeData/Task/List-comprehensions/PicoLisp/list-comprehensions-3.l

10 lines
245 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(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 @) )