Draw a sphere: Difference between revisions

(Scala contribution added.)
Line 4,091:
for (i <- math.floor(-r).toInt to Math.ceil(r).toInt; x = i + .5) {
println(
(for (j <- math.floor(-2 * r).toInt to Math.ceil(2 * r).toInt; y = j / 2.0 + .5)
y = j / 2.0 + .5)
yield if (x * x + y * y <= r * r) {
 
Line 4,117 ⟶ 4,116:
}</lang>
{{Out}}See it in running in your browser by [https://scalafiddle.io/sf/uSm8bJ9/0 ScalaFiddle (JavaScript)] or by [https://scastie.scala-lang.org/TtVHUp3aS0eDEB6YCW4gKg Scastie (JVM)].
 
=={{header|Sidef}}==
{{trans|Perl 6}}
Anonymous user