Author Topic: Grammer  (Read 108100 times)

0 Members and 4 Guests are viewing this topic.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer
« Reply #135 on: October 12, 2011, 07:16:02 am »
So as kind of a side update, I am working on writing/completing an actual tutorial for Grammer. I am also trying to add in a way to execute code as an interrupt (because this will allow for things like grayscale). So pretty much, I need to find a new token for this. I use Goto to jump to a section of code and prgm to execute code as a subroutine, so what do I use to execute the code as an interrupt?

For BASIC programmers, an interrupt in Grammer will mean that a section of code will get executed over 100 times per second along with the normal code flow.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer
« Reply #136 on: October 12, 2011, 07:17:47 am »
did you already used int()?
If you didn't, it's probably the best
interrupt XD
« Last Edit: October 12, 2011, 07:17:56 am by yeongJIN_COOL »
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer
« Reply #137 on: October 12, 2011, 07:33:06 am »
Yeah, I already used that D: Which reminds me, a few posts back I posted a way to use arrays (involving int().

Here is the post link: http://ourl.ca/11664/251481

EDIT: You were looking for a way to do this, right?

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer
« Reply #138 on: October 12, 2011, 07:36:00 am »
oh. I missed that XP
then how about augment() ?
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer
« Reply #139 on: October 12, 2011, 07:39:43 am »
I was thinking of using that to increase the size of a var. So for example, to add bytes to the end of a program file in case it has map data or sprite data or something like that.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer
« Reply #140 on: October 12, 2011, 07:41:40 am »
hmm
variance() ?
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer
« Reply #141 on: October 12, 2011, 07:44:39 am »
Wow, that is a token?
Umm, is this on all OSes? (I notice it is a two-byte token)

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer
« Reply #142 on: October 12, 2011, 07:45:56 am »
It's in List -> Math. and yes. At least, it's in OS 2.43
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer
« Reply #143 on: October 12, 2011, 07:48:04 am »
Okay, cool. Um, I am looking through the Catalog and I see "Func" as a potential token (like executing a Function)

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer
« Reply #144 on: October 12, 2011, 07:50:30 am »
That works too XD
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer
« Reply #145 on: October 12, 2011, 07:53:11 am »
Thanks much Yeong! But now I have to see how I can use the variance( token, because that seems neat... XD

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer
« Reply #146 on: October 13, 2011, 10:32:26 am »
Quote from: Grammer PDF
Code: [Select]
:Return→A
:int(rand,-1
:Goto A
:D

Don't do this
« Last Edit: October 13, 2011, 10:32:54 am by yeongJIN_COOL »
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer
« Reply #147 on: October 13, 2011, 01:55:25 pm »
I love that part, yeong :D

Here is an update on the things that have been changed or added:

DispGraph can now have a pointer to tell it which buffer to display. For example, if you want to display appBackUpScreen as a buffer, you can do DispGraphπ9872. To display the normal graph screen, just do DispGraphπ9872 (remember that the pi symbol tells it to read the number as hex). If you omit the argument, it will just display the default buffer.

Disp will let you change the default buffer location. For example, if you want to use appBackUpScreen instead of the graph screen, just do Disp π9872.

Func will let you execute a subroutine as an interrupt. Interrupts activate a little over one hundred times per second, regardless of what is happening code wise. For example, this will automatically display the graph screen, even if you don't have any other DispGraphs in your code:
Code: [Select]
FuncLbl "INTERRUPT     ;the Lbl "INTERRUPT part will return the location of the routine
Repeat getKey=15
rand/1024→Y
rand/683→X
rand/1024→R
Circle(Y,X,R,3
End
Goto Lbl "Stop          ;Jumps to the end of the code
.INTERRUPT
DispGraph
End                   ;Ends the interrupt
.Stop
Stop
Note that this isn't optimised XD

And finally, the Send( command will let you make a program or appvar of any size you want (assuming there is enough memory). So to create the program named HI with 768 bytes (which can be used as a screen buffer):
Code: [Select]
Send(768,"EHI
Programs have a prefix of "E", protected programs have a prefix of "F" and appvars have a prefix of "U"
This also returns the location of the variable in case you are using it for a buffer *cough*

Hopefully the next update will include a readme that is up to date and has more examples/explanations. For now, here is a screenie and the latest version of Grammer. Feel free to ask questions (as well as how to do things)!

Offline boot2490

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 607
  • Rating: +54/-36
    • View Profile
    • Boot2490's Stuff
Re: Grammer
« Reply #148 on: October 13, 2011, 02:58:34 pm »
It can WRITE TO PROGRAMS!?!?!?!?
I'm not worried about SOPA creating censorship, that will not stand for long. I'm worried that they'll succeed in stopping piracy!

Spoiler For Signature, updated march 23, 11:28 PM EST:















An useful tool!

PM me if you need some help. I am glad to be of assistance and part of the TI Communnity.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer
« Reply #149 on: October 13, 2011, 03:04:22 pm »
Oi, yes it can :) But now it can create them, too!

Also, here is a mini graphic I am proud of that I want to make my avatar >.>