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<999
ClrDraw
Text(0,0,"ITERATIONS:
expr(Input→I
End
Full
ClrDraw
For(A,0,111
A-64→C
For(B,0,95
B-48→D→H
C→G
For(E,0,I
G-H:*G+H:/ 32:+C→F   ;The space after the / is for using signed division
G*H
+Ans:/ 32:+D→H
If F→G2:+H2:>4096    ;This is G^2 and H^2, respectively, using the squared token
999→E
End
If E<999
Pxl-On(8+B/2,20+A/2
Is>(B
End
Is>(A
DispGraph
End
Stop
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