RosettaCodeData/Task/List-comprehensions/Oz/list-comprehensions.oz
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

20 lines
288 B
Text

functor
import
LazyList
Application
System
define
fun {Pyth N}
<<list [X Y Z] with
X <- {List.number 1 N 1}
Y <- {List.number X N 1}
Z <- {List.number Y N 1}
where X*X + Y*Y == Z*Z
>>
end
{ForAll {Pyth 20} System.show}
{Application.exit 0}
end