Draw a sphere: Difference between revisions
→{{header|Batch File}}: Add formatting...
m (→{{header|REXX}}: elided a duplicated line.) |
Simple9371 (talk | contribs) (→{{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 ▼
▲@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
{{Out}}
<pre>
|