IcarusLives

:circle x y r function

Mar 1st, 2017
964
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.07 KB | None | 0 0
  1. :circle x y r
  2.     set /a "___rr=%~3"
  3.         for /l %%y in (-%___rr%,1,%___rr%) do for /l %%x in (-%___rr%,1,%___rr%) do (
  4.            
  5.             set /a "t=-___rr - 1", "S=(%%x * %%x) + (%%y * %%y) - (___rr * ___rr) - t - 1"
  6.             if "%~5" equ "/f" (
  7.                 if !S! leq 1 (  
  8.                      set /a "_x=%%x + %~1", "_y=%%y + %~2"
  9.                     set /a "_x2=_x + 1"
  10.                     call set "_[!_y!]=%%_[!_y!]:~0,!_x!%%%~4%%_[!_y!]:~!_x2!%%"
  11.                 )
  12.             ) else if "%~5" equ "/n" (
  13.                 if !S! geq !t! (  
  14.                     set /a "_x=%%x + %~1", "_y=%%y + %~2"
  15.                     set /a "_x2=_x + 1"
  16.                     call set "_[!_y!]=%%_[!_y!]:~0,!_x!%%%~4%%_[!_y!]:~!_x2!%%"
  17.                 )
  18.             ) else if !S! geq !t! if !S! leq 1 (  
  19.                 set /a "_x=%%x + %~1", "_y=%%y + %~2"
  20.                 set /a "_x2=_x + 1"
  21.                 call set "_[!_y!]=%%_[!_y!]:~0,!_x!%%%~4%%_[!_y!]:~!_x2!%%"
  22.             )
  23.         )
  24.         for %%a in (t S _x _y _x2 ___rr) do set "%%a="
  25. goto :eof
Add Comment
Please, Sign In to add comment