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

0 Members and 1 Guest are viewing this topic.

Ashbad

  • Guest
Re: Axe Q&A
« Reply #585 on: August 12, 2011, 09:35:10 pm »
This is probably very stupid to ask, but I find myself learning Axe very slowly. I read through the document and I read tutorials on Axe. But when I read codes from open source Axe programs, I have to spend a really long time to figure out what it does, most of the time, I can't figure out either. So I'd like to ask how you learned Axe at the beginning and how did you progress to this stage?

Looking at other people's code is never a good idea to boot.  Everything does things differently, and very different coding styles -- I personally air on the side of using too many offset variables with expense of readability; DeepThought uses like a million different source files with local variables; Runer crams everything all in one; and so on and so forth.  It's not like C or even higher level languages where everything has a name, comments are actually used more than like three times per program (I don't like them in Axe, good comment takes up a whole screen), structures are easier to follow for readers, etc.

I suggest the best thing you can possibly do is practice.  Make games, utilities, or even test programs to see how things work.  This is very productive, even if you don't finish any of the games; you'll learn a lot.  Plus, you'll be sure to run into more questions a lot quicker (and ask them here for answers!), and therefore will know more and more over time than you would be reading other people's work.
« Last Edit: August 12, 2011, 09:36:26 pm by Ashbad »

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Q&A
« Reply #586 on: August 13, 2011, 07:36:04 am »
Well, for me, I learnt Basic by using people's code. And then, Axe came quite easily, even if the commands are different (but my optimization is zero). But learning Axe by using people's code could be difficult, I even have difficulties to read myself sometimes :P
(bad English, French I am, sry).
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Axe Q&A
« Reply #587 on: August 13, 2011, 11:11:54 am »
Reading other people's code is tough in axe, especially if it is very optimized. A good thing to start with is reading the command list, even if you don't understand it.

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 #588 on: August 13, 2011, 08:54:04 pm »
I learned Basic by reading through other peoples' code and through TI Basic Developer, as well as learning some things at school.  From there, Axe came pretty easily.
I recommend picking a few simple games in Axe and looking through their complete source code to see how certain things are accomplished and how they're all alike and going from there.  Good luck! :)

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #589 on: August 14, 2011, 11:49:08 am »
Which is more optimized, While 1 or Repeat 0? Or are they the same size?
« Last Edit: August 14, 2011, 11:49:30 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #590 on: August 14, 2011, 11:51:02 am »
Both are the same size: 0 bytes.

Offline baptystes

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 10
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #591 on: August 16, 2011, 04:05:46 pm »
Hey guys, sorry for my english because i am french, but can some one explain me how to use the link port, how to send some variable, files, to make a multiplayer game.
Thank's
Snake, Pong, PapyJump, Sokoban, puissance 4, d'autres jeux type casse tête...

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 #592 on: August 16, 2011, 04:28:20 pm »
Both are the same size: 0 bytes.
They're 2-3 bytes including the End, right?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #593 on: August 16, 2011, 04:31:02 pm »
2 or 3 bytes with End, 4 or 5 bytes with EndIf or End!If. But While 1 and Repeat 0 themselves result in 0 bytes of compiled code. ;)

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 #594 on: August 16, 2011, 08:32:23 pm »
But that's a moot point because Axe doesn't let you leave off the end, rendering the question itself wrong.
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 Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #595 on: August 16, 2011, 08:52:52 pm »
...I was asking about that simgle line, not the entire loop :P
2 or 3 bytes with End, 4 or 5 bytes with EndIf or End!If. But While 1 and Repeat 0 themselves result in 0 bytes of compiled code. ;)
Ok thanks, that's what I needed.
Vy'o'us pleorsdti thl'e gjaemue

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 #596 on: August 18, 2011, 05:21:53 am »
I have a question. I have just started in axe and I never programmed on the z80 calcs really before. I am used to in 68k basic to use matrices as a way to save map data. Something like this:
Code: [Select]
{{1,1,1,1,1,1},{1,0,0,0,0,1},{1,0,0,0,0,1},{0,0,0,0,0,0}}➝matrixBut I don't know if this is possible on the Ti-83+.
Maybe axe doesn't support it...
Also if it would be possible is there a limit, or can I have huge matrices? Thanks in advance. :)
« Last Edit: August 18, 2011, 05:22:30 am 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 FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Axe Q&A
« Reply #597 on: August 18, 2011, 09:43:05 am »
I have a question. I have just started in axe and I never programmed on the z80 calcs really before. I am used to in 68k basic to use matrices as a way to save map data. Something like this:
Code: [Select]
{{1,1,1,1,1,1},{1,0,0,0,0,1},{1,0,0,0,0,1},{0,0,0,0,0,0}}➝matrixBut I don't know if this is possible on the Ti-83+.
Maybe axe doesn't support it...
Also if it would be possible is there a limit, or can I have huge matrices? Thanks in advance. :)
Well, Axe doesn't technically support matrices, everything used to store data is an array of bytes.

There are a couple ways to do it. One is to use hex:
Code: [Select]
[010101010101]
[010000000001]
[010000000001]
[000000000000]➝pointer

Another way is to use the Data() command:
Code: [Select]
Data(1,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0)➝pointer
The only limit to these arrays of bytes is your free memory. If you had the memory free, you could have a 128*128 map or possibly larger.

Once you've set up your array of bytes, you would read each byte like you would a cell in a matrix.
Code: [Select]
{Y*Width+X+pointer}Where Y is your Y-coordinate, X is your X-coordinate, and Width is the width of the map, and pointer is the pointer to your map data.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Q&A
« Reply #598 on: August 18, 2011, 10:13:27 am »
Hey guys, sorry for my english because i am french, but can some one explain me how to use the link port, how to send some variable, files, to make a multiplayer game.
Thank's

To use the link port, use 'send' and 'get'

From the Axe documentation:
Send(BYTE,TIME)Tries to send the byte across the linkport. It will keep trying until the other calculator receives the byte or time runs out. Returns 1 if the byte was sent successfully or 0 if it timed-out. Time is in the order of microseconds.
GetChecks if the sender is trying to send anything. Returns the byte if it was received or -1 if nothing was sent. No waiting is done.

Note, however, that the two calculators have to be perfectly synchronized -- if the recieving calc doesn't use 'Get' at the same time the other calculator uses 'Send', the data won't be received.

What do you mean by 'sending variables and files'?  Do you mean while you're running an Axe program, or do you mean normally?

As far as I know, there really isn't any standard set of tricks that can help you make a multiplayer game; it's just critical that you design your program flow correctly.
I don't know how responsive sending and receiving is, so it might be a good idea to avoid any real-time multiplayer games, and instead make something that's more 'turn-based', if that makes sense.
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 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 #599 on: August 18, 2011, 12:10:34 pm »
I have a question. I have just started in axe and I never programmed on the z80 calcs really before. I am used to in 68k basic to use matrices as a way to save map data. Something like this:
Code: [Select]
{{1,1,1,1,1,1},{1,0,0,0,0,1},{1,0,0,0,0,1},{0,0,0,0,0,0}}➝matrixBut I don't know if this is possible on the Ti-83+.
Maybe axe doesn't support it...
Also if it would be possible is there a limit, or can I have huge matrices? Thanks in advance. :)
Well, Axe doesn't technically support matrices, everything used to store data is an array of bytes.

There are a couple ways to do it. One is to use hex:
Code: [Select]
[010101010101]
[010000000001]
[010000000001]
[000000000000]➝pointer

Another way is to use the Data() command:
Code: [Select]
Data(1,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0)➝pointer
The only limit to these arrays of bytes is your free memory. If you had the memory free, you could have a 128*128 map or possibly larger.

Once you've set up your array of bytes, you would read each byte like you would a cell in a matrix.
Code: [Select]
{Y*Width+X+pointer}Where Y is your Y-coordinate, X is your X-coordinate, and Width is the width of the map, and pointer is the pointer to your map data.
So If I didn't make a mistake here, this should draw (a part of the map) to fill the screen?
Code: [Select]
.0
[hexcode1]->pic0
.1
[hexcode2]

for a,0,11
for b,0,7
pt-on(a*8-8,b*8-8,{Y*Width+X+pointer}+pic0)
end
end
Thanks a lot Final Ti. :)


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

Interview with me