Jump to content

Draw a sphere: Difference between revisions

→‎{{header|Batch File}}: Add formatting...
m (→‎{{header|REXX}}: elided a duplicated line.)
(→‎{{header|Batch File}}: Add formatting...)
Line 818:
=={{header|Batch File}}==
In my console the sphere looked more or less spheric, but this site has a larger interval between lines, so the result looks more like an egg. The code of this sample is not ported from the C sample. Integer square root by Aacini.
<lang dos>@echo off
 
<lang Batch File>
@echo off
setlocal enabledelayedexpansion
mode con cols=80
Line 859 ⟶ 857:
set /A "x=s/(11*1024)+40,x=(s/x+x)>>1,x=(s/x+x)>>1,x=(s/x+x)>>1,x=(s/x+x)>>1,x=(s/x+x)>>1,x+=(s-x*x)>>31
set %~2=%x%
exit /b </lang>
</lang>
{{Out}}
<pre>
535

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.