• Axe Q&A 5 5
Currently:  

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

0 Members and 1 Guest are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Q&A
« Reply #660 on: September 30, 2011, 12:22:44 pm »
So in other words,
Code: [Select]
If Q=0??Blarg
stuff
End
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Axe Q&A
« Reply #661 on: October 02, 2011, 07:40:10 am »
How must I display an expression in axe?(If this is possible)
This doesn't seem to work properly. it only displays weird signs and all.
Code: [Select]
:10->x
:text(0,0,x)
Thanks in advance. :)


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Axe Q&A
« Reply #662 on: October 02, 2011, 07:48:14 am »
You need to do text(0,0,x>Dec

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Q&A
« Reply #663 on: October 02, 2011, 12:07:15 pm »
Yep, use >Dec. Otherwise it treats X as the pointer to a string, and the data at $000A probably isn't one :D

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Axe Q&A
« Reply #664 on: October 02, 2011, 01:03:04 pm »
Thanks, it helped. :D

EDIT:I have another question.
I want to save the value of x to a string, so I can see it out of my program. The following doesn't seem to work.
Code: [Select]
:10->x
:x->str1
« Last Edit: October 02, 2011, 03:30:35 pm by Stefan Bauwens »


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Q&A
« Reply #665 on: October 02, 2011, 03:44:41 pm »
Thanks, it helped. :D

EDIT:I have another question.
I want to save the value of x to a string, so I can see it out of my program. The following doesn't seem to work.
Code: [Select]
:10->x
:x->str1
You would have to write code to manually extract the digits, convert to tokens, and put into a TI-OS string variable.

Maybe something like this (input is in X, uses 5 bytes at L1 to temporarily store characters):
Code: [Select]
L1+5→A
0→B
While 1
  B+1→B
  X^10+'0'→{A-1→A}
EndIf X/10→X
Copy(A,GetCalc("Str1",B),B)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: Axe Q&A
« Reply #666 on: October 02, 2011, 05:05:52 pm »
A bunch of questions here:
1) How would I compare strings? (The equivalent of the C/C++
strcmp
) Doing
If Str1=Str2
doesn't work (and it won't compile).
2) How do I check if a program exists without using MemKit?
3) How do I check if an application exists?
4) How would I do arrays (and arrays of arrays) in Axe?
« Last Edit: October 02, 2011, 05:06:37 pm by alberthrocks »
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Axe Q&A
« Reply #667 on: October 02, 2011, 05:14:04 pm »
1. If {Str1}={Str2}
I think

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axe Q&A
« Reply #668 on: October 02, 2011, 05:18:58 pm »
i am rather sure that will only check one byte equivalence.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

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 #669 on: October 02, 2011, 05:25:14 pm »
As it happens, Axe has a command just for that purpose!
expr(Str1,Str2)
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 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 #670 on: October 02, 2011, 06:13:03 pm »
As it happens, Axe has a command just for that purpose!
expr(Str1,Str2)
I believe you mean Equ▶String(STR1,STR2).  expr (exch) just exchanges two chunks of data and would need a third argurment telling it how much to exchange. ;)

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 #671 on: October 02, 2011, 06:50:12 pm »
As it happens, Axe has a command just for that purpose!
expr(Str1,Str2)
I believe you mean Equ▶String(STR1,STR2).  expr (exch) just exchanges two chunks of data and would need a third argurment telling it how much to exchange. ;)
Whoops, silly me and my spatial thinking; the two are right next to eachother in the catalogue and I looked at the wrong one in my head when I answered. Silly me!
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 Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Q&A
« Reply #672 on: October 02, 2011, 06:57:36 pm »
To answer number 4:

There really aren't 'arrays' in Axe, but there are large chunks of memory that are kept more-or-less empty, which is the next best thing :P

'L1' is a pointer to a chunk of memory about 714 bytes long.

To assign the numbers '3', '6', '20', in the zeroth, first, and second positions, do...

Code: [Select]
3->{0+L1}
6->{1+L1}
20->{2+L1}

Here's a convenient trick to simulate an array in an array -- but only if each array inside the array is constant.

Code: [Select]
NUMBER -> {array_index * subarray_length + subarray_index + L1}

(the subarray_length starts with 1, not 0)


This is actually identical to how you do tilemaps:

Code: [Select]
{row * row_length + column + POINTER}

or...

{Y * width + X + POINTER}

If each subarray has a different length, you could perhaps make an array containing pointers to each array, although it feels a bit inception-esque to me.
« Last Edit: October 02, 2011, 06:58:00 pm by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Q&A
« Reply #673 on: October 02, 2011, 07:13:54 pm »
If each subarray has a different length, you could perhaps make an array containing pointers to each array, although it feels a bit inception-esque to me.

Yup. This is how compressed and variable-length maps are dealt with.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Q&A
« Reply #674 on: October 02, 2011, 07:18:32 pm »
Hope you don't mind the ad, but I have a full tutorial on arrays in Axe right here on Omnimaga.

The final topic? Arrays of (pointers to) arrays ;)
« Last Edit: October 02, 2011, 07:25:47 pm by Deep Thought »