Omnimaga

Calculator Community => [FR] Section Francophone => [FR] Autre Sujets de Programmation TI, Casio et Aide => Topic started by: Xeda112358 on February 15, 2012, 11:53:12 am

Title: Un Tuto Pour Grammer
Post by: Xeda112358 on February 15, 2012, 11:53:12 am
J'espere qu'il y aurait un tuto pour Grammer en français, donc j'ai decidé commencer ce projet, mais je ne parle pas français (bien).
Grammer
(un tuto en français)
   Bonjour, je m'appelle Zeda et j'ai fais le langage de programmation "Grammer." Premièrement, je ne parle pas français, donc la documentation peut-être mauvais (et, aussi, la grammaire). Le Grammer est une langage pour le TI-83+/84+/SE. Il y a un version qui est une programme ici (http://www.ticalc.org/archives/files/fileinfo/441/44104.html), mais l'application a plus des fonctions, vitesse, et les autres fonctionnalités.

Qu'est-ce que Grammer? Grammer est une langage interprété.
Comment est-ce-que vous faites une programme? Utilisez l'editeur du TI-BASIC, mais le première ligne a besoin de le code:
Code: [Select]
.0:
Aussi, j'ajoute le token Return:
Code: [Select]
.0:Return
Comment est-ce que vous arrêter une programme? Le token Stop est le token que l'arrête.
Faites une Programme
   Je voudrais commencer le tuto avec une exemple. Vous pouvez "parler" avec le programme avec les fonctions et les tokens, mais la programme peut vous "parler", aussi. Donc, il y a des fonctions pour la calcul, entée, et sortie. Par exemple:
Code: [Select]
:.0:Return
:.LOOP            ;un label
:getKey→A         ;le pression sur la touche enregistrées dans le var A
:If A=0           ;Vérifie si A est zéro
:Goto Lbl "LOOP   ;va au le label "LOOP" s'il n'y a pas un pression de touche
:ClrDraw          ;efface l'écran
:Text('0,0,A      ;écrit le nombre en le var A dans l'écran
:DispGraph        ;affiche l'écran
:Stop             ;Arréte la programme
Title: Re: Un Tuto Pour Grammer
Post by: Blue Raven on February 15, 2012, 12:28:30 pm
Hey Xeda, voici une version corrigée de ton post. Si tu veux de l'aide, tu peux poster directement en anglais, je pourrais traduire. :)

Grammer
(un tuto en français)

   Bonjour, je m'appelle Zeda et j'ai créé le langage de programmation "Grammer." Tout d'abord, je précise que je ne parle pas français, donc la documentation risque d'être mauvaise (et la grammaire aussi). Grammer est donc un langage pour les TI-83+/84+/SE. Il y a une version en programme compilé ici (http://www.ticalc.org/archives/files/fileinfo/441/44104.html), mais l'application a plus de fonctions et est plus rapide.

Qu'est-ce que Grammer ? Grammer est une langage interprété.
Comment faire un programme? en utilisant l'éditeur de TI-BASIC, sans oublier ce code sur la première ligne :

Code: [Select]
.0:
J'ajoute aussi le token Return :
   
Code: [Select]
.0:Return
Comment arrêter un programme ? En utilisant le token Stop.

Créer un premier programme

   Je voudrais commencer le tuto avec un exemple. Vous pouvez "parler" avec le programme grâce aux fonctions et aux tokens, mais la programme peut vous "parler" aussi. Donc, il y a des fonctions pour les calcul et les entrées-sortie. Par exemple :

Code: [Select]
.0:Return
.LOOP            ;un label
getKey→A         ;la touche pressée est enregistrée dans la variable A
If A=0           ;Vérifie si A vaut zéro
Goto Lbl "LOOP   ;va au le label "LOOP" s'il n'y a pas de touche pressée
ClrDraw          ;efface l'écran
Text('0,0,A      ;écrit le nombre contenu dans la variable A à l'écran
DispGraph        ;affiche l'écran
Stop             ;Arrête le programme

Le code ci-dessus va afficher la touche pressée, mais il y a de meilleures façons de le faire que je montrerais plus tard. Grammer utilise des entiers compris entre 0 et 65535 (comme en Axe). Vous pouvez également stocker ces nombres dans les variables A, B, C, etc, ainsi que dans A', B', C', etc. Le code getKey→A stocke la valeur retournée par getKey dans A.
Le token Text( sert à afficher du texte et des nombres. La syntaxe est Text(Y, X, <<valeur>>) avec Y un nombre entre 0 et 58 et X entre 0 et 23 (les caractères font 4 pixels de large). Le texte est automatiquement passé à la ligne si nécessaire. Pour afficher un nombre, il faut utiliser Text('. Pour afficher du texte, on peut faire quelque chose comme cela :

Code: [Select]
.0:Return
ClrDraw
"Hello!→A
Text(0,0,A
DispGraph
Stop

Malgré cela, A ne contient pas la chaîne de caractères ! A contient un pointeur sur la chaîne. Un pointeur contient un nombre qui pointe sur un endroit de la RAM. Voici un autre exemple, plus compliqué, utilisant des pointeurs :

Code: [Select]
.0:Return
Send(1,"ETest→Z      ;Crée un programme en BASIC et en stocke l'adresse dans Z
int(Z,49             ;Cela écrit un octet contenant 49 à l'endroit de la mémoire pointé par Z
Stop

Comme Z pointe sur le programme en BASIC, 49 (qui correspond à "1") est écrit dans le premier octet du programme. Allez-y, ouvrez le programme et vous verrez qu'il y a écrit "1". :)
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on February 15, 2012, 01:18:48 pm
Thank you much! I am trying to think of what more to add at the moment. Thanks much!
I think this can be added:

The above code will display a keypress, but there are better ways to do this that I will show later. Grammer uses integers 0 to 65535 (similar to Axe). You can also store these numbers to variables like A,B,C, et cetera, and you can also store to A',B',C' the same way. The code getKey→A stores the value output from getKey into A.

The Text( token is used to display strings or numbers. The format is Text(Y,X,<<value>> where Y is a number from 0 to 58 and X is 0 to 23 (it draws every character as 4 pixels wide). It also wraps text to the next line if it needs to. To draw a number, you need to use Text('. To draw text, you can do something like this:
Code: [Select]
.0:Return
ClrDraw
"Hello!→A
Text(0,0,A
DispGraph
Stop
However, A does not hold the string! A has a pointer to the string. A pointer has a number that points to a spot in RAM. Here is another, more complicated example using pointers:
Code: [Select]
.0:Return
Send(1,"ETest→Z      ;Creates a BASIC program variable and stores the location in Z
int(Z,49             ;This writes the byte 49 to the spot in memory pointed to by Z
Stop
Since Z points to the BASIC program, 49 (which corresponds to "1") is written to the first byte of the program. Go ahead :) Open up the program and you will see it has a 1 :)
Title: Re: Un Tuto Pour Grammer
Post by: Blue Raven on February 15, 2012, 03:19:16 pm
J'ai traduit tout ça et je l'ai ajouté à mon premier post. :)
Title: Re: Un Tuto Pour Grammer
Post by: DJ Omnimaga on February 15, 2012, 03:22:56 pm
Je suis content de voir un tutoriel en français pour grammer. :D Quand il sera fini tu devrais le placer dans la section tutorials ici aussi :D http://www.omnimaga.org/index.php?action=articles;cat=11
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on February 15, 2012, 04:09:20 pm
J'ai traduit tout ça et je l'ai ajouté à mon premier post. :)
Merci!
Je suis content de voir un tutoriel en français pour grammer. :D Quand il sera fini tu devrais le placer dans la section tutorials ici aussi :D http://www.omnimaga.org/index.php?action=articles;cat=11
D'accord :D

Aussi, les traducteurs doivent être inclus avec "l'auteurs". :)
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on March 05, 2012, 06:00:14 am
Bien Xeda :)

Est-ce qu'il y a déjà un tuto (même en Anglais) d'écrit ?
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on March 05, 2012, 08:39:55 am
Il y a un tuto en anglais, mais le tuto et un peu mauvais .__.  je pense que si je peux écriver un tuto en français, je pouvais écriver le meme tuto en anglais et les lecteurs pourraient-il lire.

err, désolé pour la grammaire x.x

There is an english tutorial, but it is a bit bad. I thought that if I could write a tutorial in french, I could write it better in english and make it easier to read. :)
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on March 05, 2012, 04:11:10 pm
Dans ce cas, j'attends celui en français :D

Title: Re: Un Tuto Pour Grammer
Post by: kindermoumoute on March 05, 2012, 04:27:32 pm
Dans ce cas, j'attends celui en français :D
je me suis dis la même chose un jour, mais c'était sur l'Axe Parser. :/

@persalteas : tu n'as pas accès à #omnimaga-fr ? Je ne t'y vois jamais. O_o
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on March 06, 2012, 02:11:52 am
Si, j'y ai accès, mais je n'ai rien de spécial a y faire...

Je suis connecté sur le tchat TI Planet assez souvent si tu veux...

Sinon, si tu veux comprendre pourquoi j'attends celui en français, regarde un peu la tête de celui en anglais... La mise en page n'est pas bien encourageante. (ça vaut pas le tien sur le site du zéro :P )
Title: Re: Un Tuto Pour Grammer
Post by: kindermoumoute on March 06, 2012, 06:42:53 am
Sinon, si tu veux comprendre pourquoi j'attends celui en français, regarde un peu la tête de celui en anglais... La mise en page n'est pas bien encourageante. (ça vaut pas le tien sur le site du zéro :P )
Un peu comme la documentation de l'Axe Parser quand j'ai commencé à apprendre. Dans un an on pourrait peut-être voir un nouveau tutoriel sur le SdZ par persalteas. :D
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on March 06, 2012, 07:36:24 am
Euh, je finis le Celtic déjà...

Et je suis sur que Xeda fera ça mieux que moi.
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 21, 2012, 12:43:06 pm
J'ai entendu que vous avez traduit le tuto, persalteas o.o Est-ce que c'est vrais?
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 21, 2012, 02:34:21 pm
Comme je te l'ai dit dans l'autre topic, j'ai fait une sorte de tutoriel inspiré de ton "commands and tutorial", mais qui est encore très incomplet, il faudrait que j'y rajoute toutes les infos diverses que tu mets dans les *.txt avec Grammer, ou sur les divers forums d'Omnimaga (comme ce sujet qui est un début de tuto). (pour les Grayscales, notament...)

Je t'envoie une première version dès que j'ai fini de travailler "commands and tutorial", pour éliminer d'éventuelles erreurs (il y en a surement quelques-unes ;) ), ça devrait prendre un ou deux jours.

Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 21, 2012, 04:29:44 pm
Okay, cool! Je sais que votre tuto sera dix fois mieux XD
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 25, 2012, 03:51:49 am
Deux ou trois posts de supprimés...

Bref, version actuelle du tuto (passé en PDF ! )  :  DERNIERE MISE A JOUR LE 25/04/2012 - 09h51 (http://tiemulation.kegtux.org/Grammer-CommandesEtTutoriel-25_04_2012.pdf)

De manière générale, je vais uploader les mises à jour sur http://tiemulation.kegtux.org/Grammertutorial.htm .
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 25, 2012, 07:07:16 am
Ah, my post was deleted :'[ It is great right now o.o (so much information and examples! :D )
There were some corrections, though. First, this table is more complete:

00=Real
log(

01=List
A

02=Matrix
B


03=EQU
C

04=String
D

05=Program
E

06=ProtProg
[
F

07=Picture
]
G

08=GDB
{
H

09=Unknown
}
I

10=Unknown Equ
J


11=New EQU
K


12=Complex
-1
L

13=Complex List
2
M

14=Undefined
N


15=Window
3
O

16=ZSto
(
P

17=Table Range
)
Q

18=LCD
2
R

19=BackUp
3
S

20=App
4
T


21=Appvar
5
U

22=TempProg
6
V

23=Group
7
W



Then, for If, you need the condition on the first line, the statement on the other:
Code: [Select]
(il ne marche pas!)
:If A=3 ou C=2:C+1→C:Horizontal C:"BONJOUR"→A
Code: [Select]
:If A=3: ou C=2
C+1→C:Horizontal C:"BONJOUR"→A

Also, not(6 = not(110b = 001b = 1 =not(0000000000000110b = 1111111111111001b =65529. En effet, 65535-6. Plus general, not(A = 65535-A.


Quote
Cette notation peut s'optimiser en getkey(9 sur les TI 84 Plus qui possèdent la fonction getkey(
Ce n'est pas vrai. getKey( est les deux tokens getKey et (. Il marche pour tout des OS.

Thank you for the tutorial so far!
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 25, 2012, 07:25:50 am
Oh ! yes, you told me about the If and the getkey...

I forgot to replace it in the tutorial.

Quote
Also, not(6 = not(110b = 001b = 1 =not(0000000000000110b = 1111111111111001b =65529. En effet, 65535-6. Plus general, not(A = 65535-A.
All the 16 bits are inverted ? OK, I didn't know.


I'll continue it, it's not finish, there is a lot of work :)
Glad you like it.
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 25, 2012, 11:38:52 am
Yeah, it is all 16-bits. And really, you are doing a great job o.o

EDIT: Also, since I uprated one of yesterdays posts that got lost, I uprated your last post :)
Title: Re: Un Tuto Pour Grammer
Post by: DJ Omnimaga on April 25, 2012, 02:29:29 pm
Deux ou trois posts de supprimés...

Bref, version actuelle du tuto (passé en PDF ! )  :  DERNIERE MISE A JOUR LE 25/04/2012 - 09h51 (http://tiemulation.kegtux.org/Grammer-CommandesEtTutoriel-25_04_2012.pdf)

De manière générale, je vais uploader les mises à jour sur http://tiemulation.kegtux.org/Grammertutorial.htm .
Oui le serveur d'Omni a manqué de RAM et tout a planté, donc les dernier posts furent corrompus. Il a fait une sauvegarde du 22 avril.
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 25, 2012, 05:50:05 pm
Quote
EDIT: Also, since I uprated one of yesterdays posts that got lost, I uprated your last post

Oh, ;D thanks ...

The day will come when I would have 447 posts ratings, like you...  (how long have you been active on Omnimaga, Xeda ? )
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 25, 2012, 08:09:39 pm
I've been active for about 1.5 years now (in 6 days it will be 1.5 years, actually). And I'm sure you will get >447 post ratings XD You are a respected coder and you make neat programs o.o
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 09:29:24 am
J'ai corrigé ces détails. J'ai aussi fait une superbe pic pour les codes du getkey :)

Spoiler For "keycodes sur une TI 83 Plus.fr ! ":
(http://data.imagup.com/12/1150112434.png)

Ensuite...

questions suivantes !

1) Where do you find the "solve(" command in the menus ? The [math][0] gives me a "Misc(" command. Is that from Grammer, or from MirageOS (or from XtraTkn ?)

2) about solve(3.

Quote
Ans and Ɵ' are put back to normal when the error handler
completes.
Do you mean they come back to 0 when the program arrives to the specified label ?

3) Explain solve(4 ... :/

4) Explain how works the duration with the conj( command... :/  64, for me, it's just Minecraft...

Thank you !
(I now have many little funny programs on my calc ;D )
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 26, 2012, 02:31:38 pm
That is an excellent picture :)
1) Where do you find the "solve(" command in the menus ? The [math][0] gives me a "Misc(" command. Is that from Grammer, or from MirageOS (or from XtraTkn ?)
Ah, yes, you have the Token Hook enabled (it changes the names of some tokens). It still does the same thing, though.


2) about solve(3.

Quote
Ans and Ɵ' are put back to normal when the error handler
completes.
Do you mean they come back to 0 when the program arrives to the specified label ?
I mean that they are preserved, or restored. This way, if your error handler changes Ans or Ɵ', it won't effect the program.

3) Explain solve(4 ... :/
:) solve(4 will automatically cause an error. For example, solve4,0 causes an ON error, solve(4,1 causes a Memory error, solve(4,2,"String" creates a custom error. This is good for custom error handling. I attached a screenshot :)

4) Explain how works the duration with the conj( command... :/  64, for me, it's just Minecraft...
If you use 64, it makes it take a long time. Try using 16 instead? (or smaller values).
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 03:20:00 pm
Quote
solve(4,2,"String" creates a custom error.
AAWWW YEAH !! Powerful !

So... I finished the "Command and Tutorial.pdf", now I will read the *.txts and the tutorial topics on Omnimaga...

I have 28 questions... Do you want them ? ;D  In one shot ? 5 by 5 ?

(Lot of my questions are about grayscale, I'll read the topic where you talk about it.)

I upload a new version soon (1h30), time to replace my questions by your answers.
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 26, 2012, 03:28:03 pm
Hehe, feel free to ask them all :D It will give me something to do :)
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 03:29:39 pm
If you want them in English, it will take a minute. :P
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 26, 2012, 03:39:04 pm
Feel free to ask in french, english, or franglish :3


(This post was made in between his two posts ^ omnom messed up, I think or my internet lagged)
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 03:45:14 pm
1)  What is the "Gray" method for displaying sprites ? (   Pt-On(7   ) Do you explain it in the topic about grayscale ? If yes, don't answer, I'll see.

2) You told talk several times about buffers to display. I didn't know that we could create custom buffers at custom adresses. I heard about the buffer and the backbuffer in Axe, but that's all. It's not very limpid, can you re-explain me what is exactly a buffer and how it works ?
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 26, 2012, 03:59:14 pm
1)  What is the "Gray" method for displaying sprites ? (   Pt-On(7   ) Do you explain it in the topic about grayscale ? If yes, don't answer, I'll see.
You form the sprite data like the MASK version, except it is gray byte, black byte, gray byte, black byte, et cetera. It lets you draw gray sprites without using two buffers (but you need to constantly draw the sprite and update the screen).

2) You told talk several times about buffers to display. I didn't know that we could create custom buffers at custom adresses. I heard about the buffer and the backbuffer in Axe, but that's all. It's not very limpid, can you re-explain me what is exactly a buffer and how it works ?
A buffer can be any area of RAM that you work with for storing data. For example, the particle buffer and drawing buffers. What you are interested in are drawing buffers, I think.

Drawing buffers are the size of the graph screen and you can draw on them, erase them, display them, or do anything else. The OS has three of these at:
pi9872 (Grammer uses this for the default particle buffer. If you aren't using this for particles, feel free to use it for drawing)
pi86EC (Grammer uses this for some functions like converting hex to sprites or executing AsmPrgm code)
pi9340 (This is the normal graph buffer).

Additionally, you can create your own by making a variable with 768 bytes (or if you want two buffers or more, use 1536, 2304, ...).

In Grammer, to set a new buffer, you can do Disp <<pointer>>. Then, all drawing you do after that is drawn to that buffer and every time you use DispGraph, that buffer is shown. Most of the drawing commands let you draw to another buffer, too.

For Grayscale, you have two buffers, the main buffer and the graybuffer. If a pixel is turned on in the gray buffer but not the black buffer, it will show as gray. If it is turned on in the black buffer or both buffers, it will show as black.
Here is an example of the gray layer, black layer, and the result:
(http://img.removedfromgame.com/imgs/GrayExample.png)
You will need to be updating the screen regularly, too, to see it as gray.
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 04:06:07 pm
Allright !! Good answer... I'll put this in the tutorial, it helps a lot.

just one precision: about gray sprites, you said in the doc that it's 3-grayscales. So the data should be 30gray-60gray-black-30gray-60gray-black-30gray-60gray-black...  ?

EDIT: I uprank your post ;D
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 26, 2012, 04:17:32 pm
3 level means white, gray (50%), black :[ I don't have four level gray yet (which is white, 33% gray, 66% gray, black).

 And thanks :)
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 04:23:32 pm
ok.

3rd question: What is the pattern with the "Circle(" command ?

EDIT:
4) What is the difference between ClrDraw and ClrHome ?

Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 26, 2012, 05:12:24 pm
3rd question: What is the pattern with the "Circle(" command ?
The pattern is the bit pattern. If the value you input has an ON bit, the pixel won't be drawn in the circle. For example, if you want every other pixel drawn in the circle:
Code: [Select]
Circle(Y,X,R,1,E10101010     ;The E is [2nd][,]
If you want 2 pixels off, two pixels on, use E10011001 (which is 153). Remember, the 1s mean to skip the pixel, 0s mean to draw it.

4th question: What is the difference between ClrDraw and ClrHome ?
ClrDraw clears the graph screen
ClrHome clears the home screen
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 05:27:25 pm
Thanks.

Quote
ClrDraw clears the graph screen
ClrHome clears the home screen

ClrDraw clears the screen, or a buffer ? The display is automatically modified, or I need a DispGraph ?

And about ClrHome: How do you put anything in the home screen ? Text( and drawing commands don't...
Is there a buffer for  the home screen ?


5) What does exactly Fill(4 ?

6) and Fill(14 ?

7) If I use augment(4,0,"DStr5"  , for example, it creates 4 new bytes at the beginning of the Str5, isn't it ? So, the string with start with...nothing ? empty bytes ?

8) [strike]You said E was used to introduce a binary string.  Is it the E from [2nd][ln]  ,   [2nd][/]  or   [2nd][,]  ?[/strike] I know the answer, now :D

9) About AsmPrgm. What is the exact syntax ?

Code: [Select]
:Asmprgmassembly-hex-code

or

:AsmPrgm
:assembly-hex-code
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 26, 2012, 05:36:34 pm
ClrDraw does not clear the LCD, just the graph buffer.
ClrHome lets you clear the homescreen in case you want to (sometimes I don't like the screen scrolling up afeter running a program >7 times)

There is actually a buffer for the homescreen, it is 128 bytes.

5) Fill(4,x draws a byte using OR logic to every byte of the buffer.I cannot easily explain, but you can test it (all values are safe)
6) Fill(14,x:
     Uses the whole screen like a sprite. Copies it with OR logic, X pixels down on the graph screen. X should be 0 to 62.
7) Yes, it fills it with empty bytes
8)
9) AsmPrgmassembly-hex-code
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 05:51:19 pm
okay. Thanks x9.

I Stop for today. I upload the new one. goodnight.
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 26, 2012, 05:53:55 pm
Good night, and thank you!
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 26, 2012, 06:27:54 pm
Updated. http://tiemulation.kegtux.org/Grammertutorial.htm
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 04:36:36 am
double post...

On continue les questions ? ;D

10) Why does the not( command compare all the 16 bits, and the xor don't ?

11) Does the "StorePic" command work, or I should store my Pics with solve( ?
Code: [Select]
:solve(1, buffer-adress , Pic1-adress , 768

12) Can you give me an example of what to do with inString ? I'm not sure I understand its role.

13) idem, for length('... :/

14) explain Fix 32 ... What is the "text mode" ?

15) explain conj(' .  I understand conj( , but not the 2 syntaxes of conj('.

Thanks for your help...
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 27, 2012, 05:23:46 am
10) Why does the not( command compare all the 16 bits, and the xor don't ?
xor does use all 16-bits, as well.
11) Does the "StorePic" command work, or I should store my Pics with solve( ?
Code: [Select]
:solve(1, buffer-adress , Pic1-adress , 768
StorePic does not work, so you will need to use your above code.
12) Can you give me an example of what to do with inString ? I'm not sure I understand its role.
Code: [Select]
.0:Return
":CAT:4CHAT:HELLO:7BONJOUR:I:2JE→A
inString(A,":HELLO:
+Ɵ'→S                ;Ɵ' is the length of ":HELLO:", S points to the 07BONJOUR part, now
IS>(S→B
ClrDraw
Text(0,0,S,B
DispGraph
Stop
13) idem, for length('... :/
This is like det(5 in Celtic3.
Code: [Select]
Get("EPROG→Z
length(Z,0,3
That will return a pointer to line 3 in EPROG and the number of bytes in the line in Ɵ'.

14) explain Fix 32 ... What is the "text mode" ?
I don't know, actually. I think I may have forgotten to remove that o.O

15) explain conj(' .  I understand conj( , but not the 2 syntaxes of conj('.
I don't know how to explain it except that it is like Axe :/
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 05:48:22 am
allright, thanks again.

Quote
I don't know how to explain it except that it is like Axe

:/ I don't know how Axe works about sound. I'll ask Matrefeytontias or kindermoumoute.
Quote
This is like det(5 in Celtic3.
Code: [Select]
Get("EPROG→Z
length(Z,0,3
That will return a pointer to line 3 in EPROG and the number of bytes in the line in Ɵ'.

Okay, but I think it's not like det(5 ;D
I thought (not sure, but I thought) that det(5 was able to read  the code-lines, not just giving a pointer.

What is the zero ? length(Z,0,3 ...


Anyway, I asked about length(prime , not length...

Title: Re: Un Tuto Pour Grammer
Post by: mdr1 on April 27, 2012, 07:20:16 am
Bonjour à tous !
On serait pas dans une section francophone par hasard ?

Bon, sinon, j'apporte une correction de la langue :

Quote
Je voudrai qu'il y ait un tutoriel pour Grammer en français ; je commence donc le projet mais ne parle pas très bien le français.
Grammer
(tutoriel français)
   Bonjour, je m'appelle Zeda et j'ai inventé le langage de programmation "Grammer." Premièrement, je ne parle pas français, donc la documentation peut-être mauvaise (et aussi la grammaire). Le Grammer est un langage pour les TI-83+/84+/SE.
Il y a une version sous forme de programme assembleur ici (http://www.ticalc.org/archives/files/fileinfo/441/44104.html), mais l'application a plus de fonctions, de vitesse, et d'options.

Qu'est-ce que Grammer? Grammer est un langage interprété.
Comment faire un programme? Utiliser l'éditeur de TI-BASIC en mettant à la première ligne :
Code: [Select]
.0:
Ajouter également le token Return (pour que ça quitte si vous l'exécutez en tant que Basic) :
Code: [Select]
.0:Return

Comment arrêter un programme Grammer ? Il suffit d'utiliser le token Stop.

Concevoir un programme
   Je voudrais commencer le tuto par un exemple. Vous pouvez "parler" au programme à travers des fonctions et des tokens, mais le programme peut lui aussi vous "parler". Donc, il y a des fonctions pour les calculs, les entrées et les sorties. Par exemple:
Code: [Select]
:.0:Return
:.LOOP            ; une étiquette
:getKey→A         ; stockage du code de la touche pressée dans A
:If A=0           ; si A vaut zéro
:Goto Lbl "LOOP   ; aller à l'étiquette "LOOP"
:ClrDraw          ; efface l'écran
:Text(0,0,A       ; affiche la valeur de A
:DispGraph        ; affiche l'écran
:Stop             ; arrête le programme
[/color]

Rassure-toi, ton niveau de français n'est pas exécrable !
Il s'agit essentiellement de corrections de genre, de grammaire, et de tournures de phrase.

@+
Title: Re: Un Tuto Pour Grammer
Post by: Hayleia on April 27, 2012, 07:31:26 am
Bonjour à tous !
On serait pas dans une section francophone par hasard ?

Bon, sinon, j'apporte une correction de la langue :

...

Rassure-toi, ton niveau de français n'est pas exécrable !
Il s'agit essentiellement de corrections de genre, de grammaire, et de tournures de phrase.

@+
Lol :P
-Si tu regardes le 2e post du topic, quelqu'un a déjà fait ce que tu as fait.
-Maintenant on parle plus ici du tutorial de Persalteas (aidé de Xeda) que de celui de Xeda seule, donc corriger celui de Xeda est hors-sujet (mais c'est sympa de vouloir aider).

Mais tu as raison, c'est une section francophone donc ils devraient en théorie parler français :)
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 07:59:22 am
On parle français, sauf quand on a envie de bien se faire comprendre.

Je comprends mieux quand Xeda parle Anglais que Français.

mdr1 --> http://tiemulation.kegtux.org/Grammertutorial.htm 

Ceci dit, la partie que tu as corrigé n'est pas inutile puisque j'ai prévu de l'intégrer dans mon tuto a moi.
Title: Re: Un Tuto Pour Grammer
Post by: mdr1 on April 27, 2012, 10:01:13 am
@Hayleia : oups, j'avais juste survolé et je croyais qu'il s'agissait de commentaires.

J'ai regardé le lien du tutoriel (que persalteas a donné), il est très bien fait !
Le seul problème, c'est qu'il manque la pratique (mais peut-être que c'est fait exprès si c'est une doc).

La méthode pour les calculs me fait penser aux anciennes calculettes programmables avec les pas, en tout cas, je trouve très bien fait et très original (c'est pour ça que je lui avais mis la meilleure note au zcontest).
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 10:06:27 am
La deuxième partie (la pratique), je commence tout juste à l'écrire...
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 27, 2012, 10:22:37 am

Désolé, j'oublie le ' pour length(' XD Et nous pouvons l'utiliser lire les ligne o.O Par exemple:
Code: [Select]
Get("EPROG→Z
Text(0,0,length('Z,0,3
Je utilise "0" pour 65536. Si vous donnez un autre nombre, il ne cherchera pas aprês ce nombre d'octets.

Also, si vous voudriez utiliser le chaîne stockez dans un chaîne du OS:D PAr exemple:
Code: [Select]
length('Z,0,3→Str2'
Text(0,0,Str2

Hmm, je suis désolé, mais il ne marche pas maintenant :/[ J'ai corrigé le code pour le prochain télécharge.

My grammer grammar sucks x_x
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 11:03:49 am
C'est bizarre.

:Text(0,0,length('Z,1,0,2  gives me the second line, yes, but:
:Text(0,0,length('Z,1,1,2  gives me the first line.

Et quel est le 4ème argument (linebyte) ? length('StartSearch,Size,LineNumber,[LineByte

And can we execute the line, if it's code ? If you use a Goto, it won't execute just the line, but all the program after it.

_____________________________________________________________________________________

Code: [Select]
length('Z,0,3→Str2'
Text(0,0,Str2
Don't work.
I didn't know that we can store strings in Str1,Str2 etc without using solve( ...
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 27, 2012, 12:06:12 pm
Awesome questions :D
:Text(0,0,length('Z,1,0,2  gives me the second line, yes, but:
:Text(0,0,length('Z,1,1,2  gives me the first line.
This is because the 1 makes it so that it will not check anything beyond 1 byte. 0 menas it won't check anything beyond 65536 bytes (0==65536).

Et quel est le 4ème argument (linebyte) ? length('StartSearch,Size,LineNumber,[LineByte
This is in case you are reading data that does not use newline tokens. For example, space=29h=41. You can do this:
Code: [Select]
.0:
"BONJOUR TOUT LE MONDE!→A
For(B,1,4
length('A,22,B,41→C
Ɵ'→D                        ;length of the string
Text(6*A-1,0,C,D
DispGraph
End
Stop

And can we execute the line, if it's code ? If you use a Goto, it won't execute just the line, but all the program after it.
Yes, use expr( :)

Code: [Select]
length('Z,0,3→Str2'
Text(0,0,Str2
Don't work.
I didn't know that we can store strings in Str1,Str2 etc without using solve( ...
Yeah, I have to fix storing to OS strings. I have the fixed version here if you want to try it out :)
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 02:45:48 pm
wonderful. ingenious. superb. amazing. terrific. splendid. dandy. great. :)

So... more questions may come... in the future :D

thanks x14 , Xeda, for your answers.

EDIT: wait ! I think I found a bug... The length( command (without prime), is supposed to return the size of the var in Ans and a pointer to this var in theta prime.

But, I tried it, and... the size given is always smaller than the real size.

And theta prime is always different that the value given by Get(.

Bug, or error from me ?
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 03:06:02 pm
wonderful. ingenious. superb. amazing. terrific. splendid. dandy. great. :)

So... more questions may come... in the future :D

thanks x14 , Xeda, for your answers.

EDIT: wait ! I think I found a bug... The length( command (without prime), is supposed to return the size of the var in Ans and a pointer to this var in theta prime.

But, I tried it, and... the size given is always smaller than the real size.

And theta prime is always different that the value given by Get(.

Bug, or error from me ?
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 27, 2012, 03:25:19 pm
Hmm, you are right, length( is not not returning the right value in theta prime.

However, it is returning the length of the actual data, properly. What you see in the memory menu is 9+namelength+data. length( returns the size of the data because that is all you need.

For example, if you create prgmHELLO with 768 bytes, in the memory menu, it says 782.
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 03:52:19 pm
okay.

EDIT: about expr( with length(' ...

if you use a pointer with expr(, how does the command know when the code line finishes ? If you use expr(Str1 , okay, it can know, but with a pointer, it should continue the code execution like with Goto...
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 27, 2012, 04:09:33 pm
Actually, expr( will just execute code until it reaches a newline. (In fact, in the assembly code, I use the same routine for If, While, Repeat).
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on April 27, 2012, 04:25:58 pm
Quote
Yeah, I have to fix storing to OS strings. I have the fixed version here if you want to try it out

I just need to do "HELLO"→Str1 ?
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on April 27, 2012, 07:27:31 pm
Yep :) Also, if you want to use it for Grammer, use ' after the string name.
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on May 03, 2012, 06:12:50 pm
Tutoriel mis à jour.
Title: Re: Un Tuto Pour Grammer
Post by: Yeong on May 03, 2012, 11:33:22 pm
Wow, your tutorial is far ahead of mine. :D
Title: Re: Un Tuto Pour Grammer
Post by: persalteas on May 04, 2012, 05:15:27 am
Quote
Wow, your tutorial is far ahead of mine.

Yeah, but you certainly have more experience than me, yours will be more precise.
Title: Re: Un Tuto Pour Grammer
Post by: Xeda112358 on May 04, 2012, 09:19:39 am
The tutorial is really good o.o There are a few more fixes, but the tutorial is really good o.o
You want:
B = Matrice

For this:
:If A=3 ou C=2

Do you want A=3: ou C=2 ?

Aussi, pour 8 niveaux de gris, il faut 3 ou 4 buffers. Si j'ajoute 4 niveaux de gris, il me faut utiliser 2 buffers, aussi.

WriteB( pointeur , contenu-8-bits


Title: Re: Un Tuto Pour Grammer
Post by: chickendude on May 06, 2012, 02:20:42 pm
C'est super le tuto, persalteas et Xeda !
Title: Re: Un Tuto Pour Grammer
Post by: DJ Omnimaga on May 06, 2012, 02:39:42 pm
Je n'ai pas eu le temps de lire le tuto dans son ensemble, mais à voir le contenu en général, excellent travail à présent! O.O