• Axe Q&A 5 5
Currently:  

Author Topic: Axe Q&A  (Read 601258 times)

0 Members and 1 Guest are viewing this topic.

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Axe Q&A
« Reply #885 on: October 30, 2011, 07:05:53 am »
I attached it below  :)
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Axe Q&A
« Reply #886 on: October 30, 2011, 02:36:00 pm »
how do I find the square root of an 8.8 number?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Axe Q&A
« Reply #887 on: October 30, 2011, 02:49:28 pm »
If you don't care too much about accuracy, you can do √(A)∗16.
Alternatively, I wrote an 8.8 square root routine in asm... If you can give me a token to use (not √( since Axe has dibs) I could make an Axiom.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #888 on: October 30, 2011, 02:54:37 pm »
I attached it below  :)


Ah this looks like a bug with Axe's peephole optimizer!  Dang it, here I was telling you to upgrade and it's not even a stable build x.x In the meantime, instead of selecting your program by pressing enter, press the Zoom button instead, and everything should work like it normally does.  

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Axe Q&A
« Reply #889 on: October 30, 2011, 03:17:22 pm »
If you don't care too much about accuracy, you can do √(A)∗16.
Alternatively, I wrote an 8.8 square root routine in asm... If you can give me a token to use (not √( since Axe has dibs) I could make an Axiom.
that would be great. Axe has lots of unuesd tokens, and I believe you can even make your own token hook if you so desire.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Axe Q&A
« Reply #890 on: October 30, 2011, 03:18:57 pm »
I decided to use seq( since it has two letters in common with sqrt(. :P

Axiom SQRT:
  seq(a): returns the square root of the 8.8 number a in 8.8 format.
  seq(a)ʳ: returns the square root of the unsigned integer a in 8.8 format.

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Axe Q&A
« Reply #891 on: October 30, 2011, 06:17:07 pm »
Ah this looks like a bug with Axe's peephole optimizer!  Dang it, here I was telling you to upgrade and it's not even a stable build x.x In the meantime, instead of selecting your program by pressing enter, press the Zoom button instead, and everything should work like it normally does. 

Doing this, it does the same as with 0.5.0/0.5.3 ...  D:
I wrote a little program that checks if the appvar really exists, also the same method as ATILOCK : I load it into an file, and display what it points to (actually the code)
What I do in this screenshot :
-I compile ATEST
-I "zoom" A(TILOCK)
-run Tilock : it's okay
-run Test : it finds the code, it's okay
-run Tilock : it asks for the code, ok
-run Test : finds the code, ok
-run Tilock : doesn't find the appvar ??? or what else ?
(-I cry)


Also, what's "zooming" ?  ::)
« Last Edit: October 30, 2011, 06:18:31 pm by Wellen »
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Q&A
« Reply #892 on: October 30, 2011, 10:03:00 pm »
I believe your screenshot is missing an End..

Also files are in general buggy; try copying the file data to an area in RAM and reading from there.

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Axe Q&A
« Reply #893 on: October 31, 2011, 02:28:51 pm »
There is an 'End', I just didn't scroll a the bottom (you talk about ATEST's code ?)

I'll try another way if the files don't work, but I just wanna know why it doesn't work
« Last Edit: October 31, 2011, 02:29:22 pm by Wellen »
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #894 on: November 03, 2011, 08:16:58 pm »
Will this work for load and save game?

Code: [Select]
:.Load game label
:Lbl L
:"appvMONEY"→Str0
:"appvLEVEL"→Str9
:Unarchive Str0
:Unarchive Str9
:!If GetCalc(Str9)→W or GetCalc(Str0)→E
:Goto N
:End
:{W}→G
:{E}→L
:Goto 1
:Lbl N
:. Im not sure what to put as the size
:GetCalc(Str0,64)→W
:GetCalc(Str9,32)→E
:0→{W}→{E}→G→L
:Lbl 1


:. At the end of the code...


:. The save subroutine
:Lbl SAVE
:Unarchive Str0
:Unarchive Str9
:G→{W)
:L→{E}
:Archive Str0
:Archive Str9
:Repeat getKey(9)
:ClrDraw
:Text(1,1,"Saved!")
:DispGraph
:End
:Return

« Last Edit: November 03, 2011, 08:22:53 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #895 on: November 03, 2011, 08:24:17 pm »
Two things wrong with that code, but if fixed, your code does look like it will work.  Firstly:

Code: [Select]
:!If GetCalc(Str9)→W or GetCalc(Str0)→E
That does not do what you think it does, because again, Axe does not follow order of operations.  It is actually doing this:

Code: [Select]
:!If ((GetCalc(Str9)→W) or GetCalc(Str0))→E
Which is not what you want.  Adding some parenthesis in the right place can help fix this problem.  Secondly:

Code: [Select]
:0→{W}→{E}→G→L
This is a quirk of Axe, but when you do 0->{#}->A, A will now hold #, not 0.  Separating these lines will help this issue

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #896 on: November 03, 2011, 08:27:17 pm »
So use
:!If ((GetCalc(Str9)→W) or GetCalc(Str0))→E
Instead?


« Last Edit: November 03, 2011, 08:30:24 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #897 on: November 03, 2011, 08:28:15 pm »
No, that was my example of what is actually happening.  You need to put parenthesis in different places in order to achieve the effect you desire.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #898 on: November 03, 2011, 08:32:21 pm »
How would I do that then?

:!If (GetCalc(Str9)→W) or (GetCalc(Str0)→E)

or something?


Also, what is a good size to use for the appvars?
{W} will be up to several thousand
{E} will be up to 6
« Last Edit: November 03, 2011, 08:32:37 pm by epic7 »

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Q&A
« Reply #899 on: November 03, 2011, 09:10:18 pm »
Is there a way to Push and Pop in Axe without having to resort to Asm()?