Omnimaga
Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: AngelFish on August 15, 2010, 03:42:45 am
-
I'm extremely new to Axe, so this is probably just User error, but for me, Axe doesn't appear to want to compile programs. I copied an extremely simple sprite control from the documentation PDF to get a feel for how the language worked without accidentally destroying my RAM. When I tried to compile it in Axe 0.4.3, it gave me a File name error. Looking at the list of errors, supposedly I designated the compiled program as the source. However, I was never given the opportunity to designate any program names for the compiled code.
And just for reference, here's the code:
:.Steel A Parser
:[3C7EDBFFBDDB663C]→Pic1
:For(A,0,19)
:rand^88→{A+L1}
:rand^54→{A+L2}
:End
:For(A,0,19)
:Pt-On({A+L1},{A+L2},Pic1)
:End
:DispGraph
In all likelihood, any help will be a "duh" moment. But thanks.
Ps: I did search the forum for similar topics, but I didn't see any.
-
The problem is your header, the
.Steel A Parser
Line. What is after the period is what the parser is trying to create your compiled program as, and so it needs to be 8 characters or shorter (also try to use all and only uppercase letters). Seems like the error documentation is slightly off. Try changing it so something just like
.AXE or .THEGAME
and it should work. Also, any future bug reports or problems should be posted in the bug reports topic, just so you know :)
-
You can put additional stuff after the name, though. Example, you could have
.AXE The Game
And if you compile for MirageOS or Ion, the stuff after .AXE would show as the file description in there.
Also welcome to the forums (and the world of Axe programming)
-
^ THIS.
Since the problem was solved, the best thing I can say is...
Welcome to Omnimaga. :D
-
Thanks. That fixed the name problem, although apparently I got my arguments wrong. BASIC-like Syntax would be a good description of Axe from what I've seen. It behaves nothing like the TI-BASIC I'm familiar with. Disp Var gives a lot of weird scrolling text in symbols I've never seen on the calculator before.
And I'll be sure to post in the Bugs thread next time. I must have missed it.
-
For your Disp problem, put a >Dec after the Disp Var. It's the first option in the MATH menu. Using >Dec displays the pointer as a number, >Char displays it as a character and >Tok diplays it as a token. If you don't put a modifier like that after Disp Var, it will attempt to display it as a string. If you're trying to display a number, there won't be a string, so it'll just output a bunch of garbage, which should be your problem.
-
I noticed the >Dec in the Documentation after I posted that, but thanks. Does anyone happen to know of a good tutorial on Axe with things like user interaction, such as an Axe equivalent of the Input() command in BASIC? Even getting the Pxl-On command to work would be great. Just Pxl-On(x, y) doesn't appear to draw anything on the screen, although that's likely because I'm confused by the whole buffers concept.
-
The best place to start is the official documentation that comes with Axe. I realize normally everybody just says screw lengthy documentations and doesn't bother with it, but it gives a very good introduction to the basics of Axe. It is well-suited for programmers who are used to TI-BASIC. Although it may look long and hard to read, it isn't all that difficult. Just read it, and trust me, stuff will make a lot more sense. (Maybe not complete sense, but a lot more)
-
Pxl-On/Off is for sprites (see docu)
Use Pt-On/Off instead
-
Pxl-On/Off is for sprites (see docu)
Use Pt-On/Off instead
No, he had it right. He probably just forgot a DispGraph after the Pxl-On(x,y).
-
Oh wait yeh.... was confused :)
Sorry about that...
-
[Facepalm]
Another "Duh" moment. I guess I had assumed it was like TI-BASIC and graph instructions brought up the graph screen.
-
the FIX command is extremely useful, if used right, you won't need to have dispgraph over and over again. (i probably am wrong.)
and welcome. Warning: stay away from Moria, we are afraid of trolls
(http://4.bp.blogspot.com/_iY2zZIXlVBE/TDAr-99GJyI/AAAAAAAAB5A/Bkty9vgtoyw/s400/Cave+troll.jpg)
(lord of the rings)
-
I noticed the >Dec in the Documentation after I posted that, but thanks. Does anyone happen to know of a good tutorial on Axe with things like user interaction, such as an Axe equivalent of the Input() command in BASIC? Even getting the Pxl-On command to work would be great. Just Pxl-On(x, y) doesn't appear to draw anything on the screen, although that's likely because I'm confused by the whole buffers concept.
In Axe (and z80 assembly), stuff is not drawn on the screen automatically, with the exception of a few things, like Output() and Bitmap()/Tangent(). It is stored inside a memory area on the calculator and you need to use the DispGraph command to update the LCD. It was done this way because the LCD driver is very slow, so updating the LCD everytime something new is displayed would be very slow. Also keep in mind Pxl-On( and Text( are X,Y, not Y,X.
In overall the graphic functions and variable storage of Axe are similar to BASIC, but some stuff, while being a bit similar, is different. The language was done so it is easier for BASIC programmers, though, so they don't have to learn a totally new language syntax from the very beginning.
-
Hey, I'm back from a vacation and just noticed this topic. For your first question, the compiler ignores lowercase letters (unless you're compiling as an app) since program names can not have any lowercase letters. Instead it will count that as part of the description. So you were compiling the program "S" with description "teel A Parser" so my guess is that your source code file was also program "S".
The Axe language in general has very high similarity to both Assembly and Basic, so a strong background in either one will definitely help with programming. An assembly tutorial will have some very useful information for you about how some things actually work and a Basic tutorial would help with program flow since the syntax is similar, however the optimizations are completely different and hardly any basic "tricks" can actually be carried over. What programming languages do you have a background in?
Reading the entire commands list as well as the documentation should be enough to get started. Some gaps can be filled with trial and error, other specific things feel free to ask in this forum, that's the primary purpose of it since there are no complete tutorials currently.
-
has anyone made an input routine though?
-
The Axe language in general has very high similarity to both Assembly and Basic, so a strong background in either one will definitely help with programming. An assembly tutorial will have some very useful information for you about how some things actually work and a Basic tutorial would help with program flow since the syntax is similar, however the optimizations are completely different and hardly any basic "tricks" can actually be carried over. What programming languages do you have a background in?
I have a background in some Python, and TI-BASIC with a little bit of experience in other languages. The language I'm most familiar with would definitely be TI-BASIC though. However, I wouldn't say I'm anything more than passable in any computer languages.
Just [another] quick question: How do you do grayscale in Axe?
-
has anyone made an input routine though?
Yes (http://ourl.ca/6581)
-
Just [another] quick question: How do you do grayscale in Axe?
That doesn't have a quick answer, but let me try to go over it briefly. So when you draw graphics, you normally draw them to the Buffer. To update the screen, you GispGraph, which copies the Buffer onto the screen. In order to do greyscale graphics, you need more than one buffer however. Drawing greyscale requires 2 buffers, the main Buffer, and the BackBuffer. You can draw to the backbuffer by adding the Polar Token r after most graphics commands (accessible under [2nd] [Angle]). And instead of updating the screen with Dispgraph, you update it with DispGraphr for 3shade greyscale, and DispGraphrr for 4 shade. The commands work like this:
DispGraphr:
Buffer BackBuffer Color
0 0 White
0 1 Grey
1 0 Black
1 1 Black
DispGraphrr:
Buffer BackBuffer Color
0 0 White
0 1 Light Grey
1 0 Dark Grey
1 1 Black
So for example if you turn a pixel on the BackBuffer, and you clear a pixel on the main Buffer, then use DispGraphrr, it will display a light grey pattern to the screen. One final note, is that you need to keep using DispGraphr or DispGraphrr repeatedly for as long as you want the screen to have different colors, if you stop, it will just look checkery and weird.
-
I thought I'd just use this post for this doubt... I tried drawing a 8*8 sprite in the back buffer, using Pt-On(X,Y,PIC)r.
Well, it doesn't give me any error, but nothing shows up... Any idea?
-
Did you use DispGraphr or DispGraphrr? Because DispGraph only displays the main buffer (L6).
-
If you have a ti-84+SE (a newer one) and axe 4.7 It might be an axe issue that i am also having.
but most likely, it is what FinaleTI said.
-
Yeah, it was what FinaleTI said XD