# Omnimaga

## Calculator Community => TI Calculators => Grammer => Topic started by: Xeda112358 on October 25, 2012, 07:28:25 pm

Title: MSet (Grammer)
Post by: Xeda112358 on October 25, 2012, 07:28:25 pm
I've been trying to make the Mandelbrot Set program in Grammer code for a little while (I made my first attempt in August), but something kept bugging out. It turns out, that all I had to do was add in a colon :P Anyways, this version I threw together yesterday after carefully writing out the code in a notebook :)

All it does at the moment is show a scaled down view of the MSet. You just run it and it computes the set appropriately. I plan to make it better for exploring the MSet zoomed in (where you can scroll the viewing area dynamically). It isn't nearly as fast as it would be in Axe or Assembly, but it is quite a bit faster than TI-BASIC which is what I was using before :P

Here is the code:
Code: [Select]
`Repeat !!I: and I<999ClrDrawText(0,0,"ITERATIONS:expr(Input→IEndFullClrDrawFor(A,0,111A-64→CFor(B,0,95B-48→D→HC→GFor(E,0,IG-H:*G+H:/ 32:+C→F   ;The space after the / is for using signed divisionG*H+Ans:/ 32:+D→HIf F→G2:+H2:>4096    ;This is G^2 and H^2, respectively, using the squared token999→EEndIf E<999Pxl-On(8+B/2,20+A/2Is>(BEndIs>(ADispGraphEndStop`
Title: Re: MSet (Grammer)
Post by: Yeong on October 25, 2012, 09:21:02 pm
Nice. :D
Title: Re: MSet (Grammer)
Post by: Xeda112358 on October 25, 2012, 09:24:10 pm
Thanks :D The math is a bit weird the way I did it. Also, the colon that I was missing was at ":>4096" and I was under some impression that I didn't need it >.>
Title: Re: MSet (Grammer)
Post by: Sorunome on October 25, 2012, 10:22:13 pm
woo, this is looking nice! :D