Author Topic: MSet (Grammer)  (Read 1868 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4607
  • Rating: +716/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
MSet (Grammer)
« 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

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: MSet (Grammer)
« Reply #1 on: October 25, 2012, 09:21:02 pm »
Nice. :D
Sig wipe!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4607
  • Rating: +716/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: MSet (Grammer)
« Reply #2 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 >.>

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7917
  • Rating: +373/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: MSet (Grammer)
« Reply #3 on: October 25, 2012, 10:22:13 pm »
woo, this is looking nice! :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!