Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: p2 on June 17, 2011, 06:51:18 am

Title: Converting this in Axe-Language
Post by: p2 on June 17, 2011, 06:51:18 am
Is it possible to wrire the following Code in Axe language?
I want to make an APP of it, but don't think it would be possible.


Code: [Select]
:Lbl 2
:randInt(iPart(Xmin),iPart(Xmax))→A
:randInt(iPart(Ymin),iPart(Ymax))→B
:mean({Xmin,Xmax})→X
:mean({Ymin,Ymax})→Y
:Lbl 1
:Pt-On(X,Y
:Pt-On(A,B
:If A≥Xmax or A≤Xmin or B≥Ymax or B≤Ymin:Goto 2
:A→P
:B→Q
:If X>B:1→Z
:If X>B:-1→Z
:If Y>A:1→V
:If Y>A:-1→V
:A+Z→A
:If (Y-B)=0:B+1→B
:B+Vabs(((X-Z)-A)/(Y-B))→B
:If √((A-P)²+(B-Q)²)≥200:Goto 2 //200 is how long a streak could be (max.)
:Line(A,B,P,Q
:Goto 1


If you want to know what this program is doing, pleas copy the code on your TI.
I can't describe it in English.  :-\


But Is it possible to write it in Axe Language?
Title: Re: Converting this in Axe-Language
Post by: Ashbad on June 17, 2011, 07:23:18 am
While tihs could be technically made into Axe compatible code, it wouldn't be nearly as Axe-like as if it were simply just written in Axe from the bottom up.  Good Axe coders don't start with BASIC code and convert to Axe, they start and end with Axe only ;)
Title: Re: Converting this in Axe-Language
Post by: p2 on June 17, 2011, 07:25:06 am
Yes.
But is it possible to make an APP of this with Axe?

I ask because there are many decimals...
Title: Re: Converting this in Axe-Language
Post by: Ashbad on June 17, 2011, 07:30:16 am
yes, that is possible.  But since your topics use Xmax etc., it'll be hard to exmulate it exactly.  I say you try to port it more conceptually than chenge it line by line, by maybe just plotting things using a simple hand-made algorithm, rather than try to make every line transfer over to Axe code.
Title: Re: Converting this in Axe-Language
Post by: p2 on June 17, 2011, 07:47:02 am
I've just used Xmax, Xmin, Ymax and Ymin because else it would be a problem with the program.
You can use 0 as Xmin and as ymin and 94 as xmax.
62can be Ymax.



Can you please copy it on your TI and tell me how to discribe something like that?
(I don't know how to describe something like that in English)







Have you tried it?
Title: Re: Converting this in Axe-Language
Post by: Runer112 on June 17, 2011, 09:27:59 am
Here's the closest conversion I could come up with. It's not optimized much, as I tried to make the conversion appear 1:1 as much as possible. It runs a lot smoother than the screenshot would suggest, I just recorded it at a low framerate to ensure that most browsers could view it at the correct speed.


EDIT: Also, it's entirely possible that this is not the effect you wanted, because I'm not sure if the code you posted originally is a fully correct copy of your program. Certain parts seemed strange, like:
Code: [Select]
:If X>B:1→Z
:If X>B:-1→Z
:If Y>A:1→V
:If Y>A:-1→V
Title: Re: Converting this in Axe-Language
Post by: p2 on June 17, 2011, 09:31:01 am
Super!  :D
thanx!
Title: Re: Converting this in Axe-Language
Post by: Deep Toaster on June 17, 2011, 12:17:07 pm
If you just want to convert it into an app, you don't need to rewrite it in Axe. Just use BasicBuilder (http://www.ticalc.org/archives/files/fileinfo/321/32127.html), a tool that packages BASIC programs into apps.
Title: Re: Converting this in Axe-Language
Post by: Keoni29 on June 19, 2011, 12:33:45 pm
Why do you want to convert everything to axe. Axe is not ment for these thing. Axe is a language especially for games.
Title: Re: Converting this in Axe-Language
Post by: jnesselr on June 19, 2011, 09:57:14 pm
Why do you want to convert everything to axe. Axe is not ment for these thing. Axe is a language especially for games.
That's not true at all, actually.  Axe excels at games because of it's asm like speed, but it is useful in other applications where speed is crucial, but precise math is not.

And I wouldn't suggest converting everything to axe, but yes, basicbuilder is a good choice for basic to app conversion.