Skip to content

Instantly share code, notes, and snippets.

@mridgers
Created February 12, 2012 21:47
Show Gist options
  • Save mridgers/1811009 to your computer and use it in GitHub Desktop.
Save mridgers/1811009 to your computer and use it in GitHub Desktop.
Mandelbrot set generator in 332 bytes of batch script (with Unix line endings).
@echo off
setlocal enabledelayedexpansion
set r=set /a
for /l %%y in (-16,1,16) do (
set l=
for /l %%x in (-57,1,21) do (
set u=0
set v=0
set "j=M.-+l$?+*:="'~-. "
for /l %%i in (0,1,15) do (
%r% m=u*u/256
%r% n=v*v/256
%r% o=m+n
if !o! lss 999 (
%r% v=2*u*v/256+%%y*20
%r% u=m-n+%%x*9
set j=!j:~1!
))
set l=!l!!j:~0,1!
)
echo !l!
)
@mridgers
Copy link
Author

Ha, nope! Fairly straight forward though to add that option though by changing out the "_20" and "_9".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment