Author Topic: Converting this in Axe-Language  (Read 6512 times)

0 Members and 1 Guest are viewing this topic.

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Converting this in Axe-Language
« 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?
*insert supercool signature*

Ashbad

  • Guest
Re: Converting this in Axe-Language
« Reply #1 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 ;)

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Converting this in Axe-Language
« Reply #2 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...
*insert supercool signature*

Ashbad

  • Guest
Re: Converting this in Axe-Language
« Reply #3 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.

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Converting this in Axe-Language
« Reply #4 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?
*insert supercool signature*

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Converting this in Axe-Language
« Reply #5 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
« Last Edit: June 17, 2011, 09:30:08 am by Runer112 »

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Converting this in Axe-Language
« Reply #6 on: June 17, 2011, 09:31:01 am »
Super!  :D
thanx!
*insert supercool signature*

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: Converting this in Axe-Language
« Reply #7 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, a tool that packages BASIC programs into apps.




Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Converting this in Axe-Language
« Reply #8 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.
If you like my work: why not give me an internet?








Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Converting this in Axe-Language
« Reply #9 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.