Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Xeda112358

Pages: 1 ... 207 208 [209] 210 211 ... 317
3121
Grammer / Re: Grammer
« on: October 02, 2011, 11:17:01 am »
I think I can manage that... This will give something to do for a while :D

3122
Grammer / Re: Grammer
« on: October 02, 2011, 11:13:29 am »
How would that work? If it is what I think, I might have to work on a routine for that... :D

3123
ASM / Re: Getting Data in Op Vars
« on: October 02, 2011, 10:48:40 am »
I am confused about what you mean? What exactly are you trying to copy? From where exactly?

EDIT: If you are copying floating point data, it is already in the correct format. So if that is the case, just copy it to OP1 by pointing HL to the data and then using the rst mentioned :)

3124
Grammer / Re: Grammer
« on: October 02, 2011, 09:21:37 am »
That wasn't too difficult, that is why it was fast XD However, particle effects might be D:

Also, I added the /Text( as another option and I found an issue :( If you tried using Typewriter Textas well as displaying a number or displaying text at the last cursor position, it would not work. So, I fixed that :)
Now Text( has four operators O.O

And I would also like to point out that the only "tricky" part to this was making tokens display one character at a time. Luckily, I use my own text display routine, so it wasn't impossible XD

So now I have a question: What modes should I add? For example, Text Inverse is one I can add. I plan to change modes using Fix, so for example, Fix 1 is text inverse, Fix 0 turns it off. Does anybody else have mode ideas?

3125
Grammer / Re: Grammer
« on: October 01, 2011, 09:42:16 pm »
Okay, I added that in, but I am not sure if this will be permanent... should it be? Here is a screenie as well as the Grammer version with the update...

EDIT: Also, I added a way to change the text display speed of this mode. Use Fix Text( followed by a number (smaller number=faster display)

3126
Grammer / Grammer Tutorial
« on: October 01, 2011, 05:30:48 pm »
This is probably going to gloss over a lot of key aspects, so if you have questions, feel free to ask :)
I realised that I still have yet to actually upload a tutorial anywhere for how to program with Grammer, so here goes :) This first section will describe some of the key aspects and it will provide an example :)

Part 1:
First off, I would like to introduce you to Grammer. Grammer is an interpreted programming language (like TI-BASIC), that can be programmed on your calculator (like TI-BASIC). If you program a lot in TI-BASIC, that will be helpful in learning Grammer, but it might cause some confusion, too. Because of that, I will introduce you to some of the key differences:

Numbers:
(simple) In Grammer, values are integers from 0 to 65535. Anything above or below is looped back around.
(complicated) Grammer uses 16-bit math. This makes things fast and simple for the interpreter while still being useful for games (I could have gone with 8-bit for even faster speed)

Math:
(simple) Math is done right to left and doesn't use order of operations. There are no parantheses. Also, overflow is detected for many operations and the overflow is stored to another var (theta prime)
(extra) Theta prime usually holds remainders or "carry." For example, if adding exceeds 16-bit range, 1 is returned as a "seventeenth bit."

Variables:
(simple) The letters can be used like in BASIC. These are called pointer vars in Grammer. You have A through Theta as well as their primes. For example, A and A' are two different pointer vars. Theta prime is used by the interpreter to return extra data or info so there are 53 vars to use and a system var. There are also strings and programs that can be accessed. To do this, you store them to a pointer var. For example, "HELLO→A is valid.
(complicated) When storing strings to a pointer var, you are actually storing the memory address that the data is located at. This is why they are called pointer vars. They point to the data, they don't actually contain it.

Using this information and a command reference, you will be on your way to making games!
(you can even use this to run algorithms faster than BASIC, if you are interested!)

So no we will make a simple program that moves a cursor around the screen! To do this, we will use the rectangle commands, getKey, and a Repeat loop. Depending on how you want the program to run will determine the header. For now, use .0:Asm(prgmGRAMMER as that will work universally for any method:
Code: [Select]
.0:Asm(prgmGRAMMER         ;This is the start of the program
0→X →Y                     ;Initiallises the coordinates. Note the space.
Repeat A=15                ;A will hold have the keypress, so this checks for [CLEAR]
Line(X,Y,6,6,2             ;draws an inverted 8x8 rectangle
DispGraph                  ;updates the LCD screen
Line(X,Y,6,6,2             ;Reinverts the rectangle.
Repeat A                   ;Repeats loop until A is not 0
getKey→A                   ;Stores the key code to A
End                        ;Ends the Repeat loop
X+A=3 -A=2                 ;Updates X coordinate based on key press, Result in Ans
If <91                     ;If it goes below zero, so this checks for going offscreen!
→X                         ;If it is on screen still, the new value is stored to X
Y+A=1 -A=4                 ;Updates X coordinate based on key press, Result in Ans
If <59                     ;Checks if the cursor would be offscreen
→Y                         ;If it is on screen still, the new value is stored to Y
End

Stop                       ;Ends the program
Press Clear or ON to exit :)

3127
Grammer / Re: Grammer
« on: October 01, 2011, 05:19:23 pm »
Could you do filled shapes?
Grammer currently does this with rectangles (10 fill methods)
I plan to do this with circles, eventually, too.
Other polygons might be a tad more difficult :/
Thick lines?
Once I actually add in a line drawing routine, I can probably do this :) My main issue is that I try to do things optimally for speed. For example, with rectangles, there is a method to draw the outline of a rectangle and clear the inside. It doesn't draw two rectangles to do this because that could really slow down the routine. Instead, it is its own, completely different drawing method :)
Text outputted one letter at a time? (typewriter style)
This can be done and might be pretty neat :) My question is, should this be a mode or should a special symbol be used in the Text( command to tell it to type that way?
Particle effects?
* Xeda112358 is cunfooz?
Greyscale?
I don't plan to add in built in grayscale, but you can simulate it, still :)

Thanks for the suggestions!

3128
ASM / Re: Quick Routine
« on: October 01, 2011, 02:50:48 pm »
Sorry, I have never done anything like that, so I can't help off the top of my head :/ I know you can use the actual bcalls to those commands, I am just not sure of the syntax for things like prompt.

3129
Grammer / Re: Grammer
« on: October 01, 2011, 02:20:42 pm »
Ah, okay. Well, not yet. I just want to warn that the Line(' command isn't totally complete, though XD

3130
Grammer / Re: Grammer
« on: October 01, 2011, 02:18:08 pm »
What do you mean by token changes?

3131
Grammer / Re: Grammer
« on: October 01, 2011, 02:08:05 pm »
Sorry for the double post, but Yeong had a few great ideas! The first that I will talk about is accessing OS vars. We can now access the OS vars (A through Theta) in Grammer. We can read the values and write to them by prefixing their names with the imaginary i [2nd][.] then the letter. For example:
Code: [Select]
3→iA
iB→C
That stores 3 to OS var A and then stores OS var B to Grammer var C. So now we can interact better with BASIC programs (especially since Grammer code can be used inside BASIC programs).

So that is pretty neat, yes? So now for the second part of the update: Using multiple conditionals. Before, if you wanted to test, say, if C=5 or Enter is being pressed, you needed to have part of the conditional outside of an if statement:
Code: [Select]
getKey=9
If +C=5
...
This was a pain if you needed to preserve Ans! So now we can do something like this, by adding in a space or a colon between conditions:
Code: [Select]
If getKey=9 +C=5
...
The " +" is like using an OR operation on the two conditions, by the way. Similarly, " *" is like using AND. Also, this is not limited to only two conditions or just If statements. This can be used for While and Repeat loops, too :)

3132
Grammer / Re: Grammer
« on: October 01, 2011, 10:59:01 am »
Maybe, I am not sure yet. If I do, I will have to create my own variable storage system, which could be interesting. If I make lists, for example, to access the first element, you would need to do something like {L1→A or to access the next element, {L1+2→A because it would really just be an array of data.

I think I could add a way to create your own vars and then use them for data storage :)

3133
Grammer / Re: Grammer
« on: October 01, 2011, 10:35:15 am »
It doesn't use lists or matrices, actually :) It just pixel tests :)


EDIT: Okay, this is probably useful to some people... Making sprites isn't the easiest of processes in Grammer, so here is a screeny showing two ways of making sprite data :)

3134
Grammer / Re: Grammer
« on: October 01, 2011, 10:24:00 am »
Stefan Bauwens: Thanks :) Also, you are almost evil O.O
As long as you need to rely on Ans. Otherwise, you can do something like this:
Code: [Select]
getKey=9
If *C=1
<<code>>
That will be like using getKey=9 and C=1. Likewise, you can do:
Code: [Select]
getKey=9
If +C=1
<<code>>
That will be like using or .

3135
Grammer / Re: Grammer
« on: September 30, 2011, 05:35:53 pm »
Well Axe is faster, but the code is typically larger.
Grammer is faster than BASIC (usually by a lot), and about the same size code (but it still has lots of optimisations for size and speed compared to BASIC).

Pages: 1 ... 207 208 [209] 210 211 ... 317