Author Topic: Un Tuto Pour Grammer  (Read 35119 times)

0 Members and 1 Guest are viewing this topic.

Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: Un Tuto Pour Grammer
« Reply #45 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.
« Last Edit: April 27, 2012, 08:13:21 am by persalteas »


Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Un Tuto Pour Grammer
« Reply #46 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).



Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: Un Tuto Pour Grammer
« Reply #47 on: April 27, 2012, 10:06:27 am »
La deuxième partie (la pratique), je commence tout juste à l'écrire...


Offline Xeda112358

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

Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: Un Tuto Pour Grammer
« Reply #49 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( ...


Offline Xeda112358

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

Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: Un Tuto Pour Grammer
« Reply #51 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 ?
« Last Edit: April 27, 2012, 03:05:58 pm by persalteas »


Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: Un Tuto Pour Grammer
« Reply #52 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 ?


Offline Xeda112358

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

Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: Un Tuto Pour Grammer
« Reply #54 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...
« Last Edit: April 27, 2012, 03:59:51 pm by persalteas »


Offline Xeda112358

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

Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: Un Tuto Pour Grammer
« Reply #56 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 ?


Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Un Tuto Pour Grammer
« Reply #57 on: April 27, 2012, 07:27:31 pm »
Yep :) Also, if you want to use it for Grammer, use ' after the string name.

Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: Un Tuto Pour Grammer
« Reply #58 on: May 03, 2012, 06:12:50 pm »
Tutoriel mis à jour.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Un Tuto Pour Grammer
« Reply #59 on: May 03, 2012, 11:33:22 pm »
Wow, your tutorial is far ahead of mine. :D
Sig wipe!