Pythagorean quadruples: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: Added Ruby)
Line 1,617: Line 1,617:
s2 = s
s2 = s
(x+1).step(n) do |y|
(x+1).step(n) do |y|
l[y]=true if l_add[s1]
l[y] = true if l_add[s1]
s1 += s2
s1 += s2
s2 += 2
s2 += 2
Line 1,628: Line 1,628:
<pre>1 2 4 5 8 10 16 20 32 40 64 80 128 160 256 320 512 640 1024 1280 2048
<pre>1 2 4 5 8 10 16 20 32 40 64 80 128 160 256 320 512 640 1024 1280 2048
</pre>
</pre>

=={{header|Scala}}==
=={{header|Scala}}==
{{Out}}Best seen running in your browser either by [https://scalafiddle.io/sf/drfij1d/0 ScalaFiddle (ES aka JavaScript, non JVM)] or [https://scastie.scala-lang.org/6AHn7YXSRbKHzmOY5rWAwg Scastie (remote JVM)].
{{Out}}Best seen running in your browser either by [https://scalafiddle.io/sf/drfij1d/0 ScalaFiddle (ES aka JavaScript, non JVM)] or [https://scastie.scala-lang.org/6AHn7YXSRbKHzmOY5rWAwg Scastie (remote JVM)].