Mandelbrot Set Viewer
This is a colorized Mandelbrot set viewer. A Mandelbrot set is a mathematical set of points whose boundary is a distinctive and easily recognizable two-dimensional fractal shape.
Commands:
@create,
@describe,
@dolist,
@lock,
@pemit,
@switch,
@vl,
@vn,
@vp,
@vs,
@vt,
@vx,
@vy,
@wait.
Functions:
add(),
cand(),
dec(),
edit(),
fdiv(),
first(),
graball(),
if(),
ifelse(),
isnum(),
lnum(),
map(),
matchall(),
mid(),
mul(),
pemit(),
repeat(),
rest(),
set(),
setdiff(),
setq(),
setr(),
setunion(),
space(),
sub(),
u(),
vadd(),
vmul(),
vsub().
Features:
color substitutions.
Compatibility:
TinyMUX.
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for Mandelbrot Set Viewer
@create %xh%xrM%xn%xra%xyn%xhd%xge%xn%xcl%xhb%xbr%xn%xbo%xmt
@lock Mandelbrot==me
&MB_INIT Mandelbrot=set(%!,vs:[fdiv(sub(%2,%0),39)])[set(%!,vt:[fdiv(sub(%1,%3),19)])][set(%!,vx:%0)][set(%!,vy:%3)][set(%!,vp:[repeat(4%b,20)])][set(%!,vl:[u(mb_scale)])]
@VS Mandelbrot=0.057692307692307696
@VT Mandelbrot=0.11842105263157894
@VX Mandelbrot=-1.7
@VY Mandelbrot=-1.125
&MB_LEFT Mandelbrot=setq(r,setr(a,vadd(vmul(lnum(00,19),%vs),repeat(%vx%b,20))))[setq(t,)][setq(i,setr(b,repeat(add(mul(%0,%vt),%vy)%b,20)))][setq(o,0)][setq(l,repeat(0%b,20))][map(mb_iter,lnum(1,%vn),,@@)][u(mb_post)]
&MB_RIGHT Mandelbrot=setq(r,setr(a,vadd(vmul(lnum(20,39),%vs),repeat(%vx%b,20))))[setq(t,)][setq(i,setr(b,repeat(add(mul(%0,%vt),%vy)%b,20)))][setq(o,0)][setq(l,repeat(0%b,20))][map(mb_iter,lnum(1,%vn),,@@)][u(mb_post)]
@VN Mandelbrot=50
&MB_ITER Mandelbrot=setq(c,%qb)[setq(b,vadd(vmul(2,vmul(%qa,%qb)),%qi))][setq(a,vadd(vsub(setr(x,vmul(%qa,%qa)),setr(y,vmul(%qc,%qc))),%qr))][setq(t,%qt [edit(setr(h,setdiff(matchall(vsub(%vp,vadd(%qx,%qy)),-*),%qo)),%b,:%0%b)]:%0%b)][setq(o,setunion(%qo,%qh))]
@VP Mandelbrot=4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
&MB_POST Mandelbrot=setq(g,%cX[space(20)])[if(setr(e,setdiff(%qt,graball(%qt,:*))),map(map_rep,%qe,,@@))]%qg
&MB_SCALE Mandelbrot=%cX%b%cn%ch%crXX%cn%crXXXXX%cyXXXXX%cy%chXXXXX%cgXXXXX%cn%cgXXXXX%ccXXXXX%chXXXXX%cbXXXXX%cn%cbXXXXX%cmXXXXX%chXXXXX
&MB_SCALE2 Mandelbrot=%cX%b%cn%ch%crXX%cn%crX%ch%crX%cn%crX%chX%cn%crX%cyX%crX%cyX%crX%cyX%chX%cn%cyX%chX%cn%cyX%chX%cgX%cyX%cgX%cyX%cgX%cn%cgX%chX%cn%cgX%chX%cn%cgX%ccX%cgX%ccX%cgX%ccX%chX%cn%ccX%chX%cn%ccX%chX%cbX%ccX%cbX%ccX%cbX%cn%cbX%chX%cn%cbX%chX%cn%cbX%cmX%cbX%cmX%cbX%cmX%chX%cn%cmX%chX%cn%cmX%chXX
&MAP_REP Mandelbrot=setq(g,mid(%qg,0,dec(first(%0,:)))[mid(%vl,rest(%0,:),1)][mid(%qg,first(%0,:),3000)])
&CMD_MB Mandelbrot=$mb *,*,*,*:@swi ifelse(cand(isnum(%0),isnum(%1),isnum(%2),isnum(%3)),u(mb_init,%0,%1,%2,%3)1,pemit(%#,One of the coordinates entered contains a non-number.))=1,@dolist lnum(20)=@pemit %#=u(mb_left,##)[u(mb_right,##)]
@Desc Mandelbrot=This is a colorized Mandelbrot set viewer. To use it, type "mb <x0>,<y0>,<x1>,<y,1>" where <x0>,<y0> is the top left of the window and <x1,y1> is the lower right of the window.%r%rRecommended coordinates:%r-1.7,1.125,0.55,-1.125%r-1.5,.5,-.5,-.5%r-.9,0,-.6,-.25
@wait 0={@VL Mandelbrot=%xX %xn%xh%xrXX%xn%xrXXXXX%xyXXXXX%xhXXXXX%xgXXXXX%xn%xgXXXXX%xcXXXXX%xhXXXXX%xbXXXXX%xn%xbXXXXX%xmXXXXX%xhXXXXX}
&NOTE Mandelbrot=Please credit the insane author, Ian@BrazilMUX. This is _donateware_. If you enjoyed this softcode or found it useful in any way (unlikely), please donate to your favorite insane asylum!
@lock Mandelbrot==me
&MB_INIT Mandelbrot=set(%!,vs:[fdiv(sub(%2,%0),39)])[set(%!,vt:[fdiv(sub(%1,%3),19)])][set(%!,vx:%0)][set(%!,vy:%3)][set(%!,vp:[repeat(4%b,20)])][set(%!,vl:[u(mb_scale)])]
@VS Mandelbrot=0.057692307692307696
@VT Mandelbrot=0.11842105263157894
@VX Mandelbrot=-1.7
@VY Mandelbrot=-1.125
&MB_LEFT Mandelbrot=setq(r,setr(a,vadd(vmul(lnum(00,19),%vs),repeat(%vx%b,20))))[setq(t,)][setq(i,setr(b,repeat(add(mul(%0,%vt),%vy)%b,20)))][setq(o,0)][setq(l,repeat(0%b,20))][map(mb_iter,lnum(1,%vn),,@@)][u(mb_post)]
&MB_RIGHT Mandelbrot=setq(r,setr(a,vadd(vmul(lnum(20,39),%vs),repeat(%vx%b,20))))[setq(t,)][setq(i,setr(b,repeat(add(mul(%0,%vt),%vy)%b,20)))][setq(o,0)][setq(l,repeat(0%b,20))][map(mb_iter,lnum(1,%vn),,@@)][u(mb_post)]
@VN Mandelbrot=50
&MB_ITER Mandelbrot=setq(c,%qb)[setq(b,vadd(vmul(2,vmul(%qa,%qb)),%qi))][setq(a,vadd(vsub(setr(x,vmul(%qa,%qa)),setr(y,vmul(%qc,%qc))),%qr))][setq(t,%qt [edit(setr(h,setdiff(matchall(vsub(%vp,vadd(%qx,%qy)),-*),%qo)),%b,:%0%b)]:%0%b)][setq(o,setunion(%qo,%qh))]
@VP Mandelbrot=4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
&MB_POST Mandelbrot=setq(g,%cX[space(20)])[if(setr(e,setdiff(%qt,graball(%qt,:*))),map(map_rep,%qe,,@@))]%qg
&MB_SCALE Mandelbrot=%cX%b%cn%ch%crXX%cn%crXXXXX%cyXXXXX%cy%chXXXXX%cgXXXXX%cn%cgXXXXX%ccXXXXX%chXXXXX%cbXXXXX%cn%cbXXXXX%cmXXXXX%chXXXXX
&MB_SCALE2 Mandelbrot=%cX%b%cn%ch%crXX%cn%crX%ch%crX%cn%crX%chX%cn%crX%cyX%crX%cyX%crX%cyX%chX%cn%cyX%chX%cn%cyX%chX%cgX%cyX%cgX%cyX%cgX%cn%cgX%chX%cn%cgX%chX%cn%cgX%ccX%cgX%ccX%cgX%ccX%chX%cn%ccX%chX%cn%ccX%chX%cbX%ccX%cbX%ccX%cbX%cn%cbX%chX%cn%cbX%chX%cn%cbX%cmX%cbX%cmX%cbX%cmX%chX%cn%cmX%chX%cn%cmX%chXX
&MAP_REP Mandelbrot=setq(g,mid(%qg,0,dec(first(%0,:)))[mid(%vl,rest(%0,:),1)][mid(%qg,first(%0,:),3000)])
&CMD_MB Mandelbrot=$mb *,*,*,*:@swi ifelse(cand(isnum(%0),isnum(%1),isnum(%2),isnum(%3)),u(mb_init,%0,%1,%2,%3)1,pemit(%#,One of the coordinates entered contains a non-number.))=1,@dolist lnum(20)=@pemit %#=u(mb_left,##)[u(mb_right,##)]
@Desc Mandelbrot=This is a colorized Mandelbrot set viewer. To use it, type "mb <x0>,<y0>,<x1>,<y,1>" where <x0>,<y0> is the top left of the window and <x1,y1> is the lower right of the window.%r%rRecommended coordinates:%r-1.7,1.125,0.55,-1.125%r-1.5,.5,-.5,-.5%r-.9,0,-.6,-.25
@wait 0={@VL Mandelbrot=%xX %xn%xh%xrXX%xn%xrXXXXX%xyXXXXX%xhXXXXX%xgXXXXX%xn%xgXXXXX%xcXXXXX%xhXXXXX%xbXXXXX%xn%xbXXXXX%xmXXXXX%xhXXXXX}
&NOTE Mandelbrot=Please credit the insane author, Ian@BrazilMUX. This is _donateware_. If you enjoyed this softcode or found it useful in any way (unlikely), please donate to your favorite insane asylum!