List comprehensions: Difference between revisions

→‎Insitux: implementation
m (→‎{{header|Python}}: make it actually work/be runnable (on 2.7))
(→‎Insitux: implementation)
Line 1,045:
12 16 20
->
</pre>
 
=={{header|Insitux}}==
 
{{Trans|Clojure}}
 
<syntaxhighlight lang="insitux">
(function pythagorean-triples n
(let n+1 (inc n))
(for x (range 1 n+1)
y (range x n+1)
z (range y n+1)
(when (!= (+ (* x x) (* y y)) (* z z))
(continue))
[x y z]))
 
(pythagorean-triples 20)
</syntaxhighlight>
{{out}}
<pre>
[[3 4 5] [5 12 13] [6 8 10] [8 15 17] [9 12 15] [12 16 20]]
</pre>
 
112

edits