Join us on Discord!
You can help CodeWalrus stay online by donating here.

Some super crappy Axe code...

Started by p2, August 24, 2016, 11:41:43 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

E37


If {r3-1} and °RightLedge!=0

Wait... You can use "!" outside of If statements?
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

p2

Quote from: Hayleia on August 31, 2016, 09:11:35 AM
Quote from: p2 on August 31, 2016, 08:19:32 AM
but how about multiple expressions? Will this be accepted? And fo I have to put an "End" then or is it just not possible uing the "?" stuff?
A=B?5->A:10->B,10->A:5->B
No, that's not possible this way. There are stupid ways to make it possible sometimes, like putting a "useless" Select (such as "A=B?Select(5->A,10->B),Select(10->A,5->B)", which quickly becomes ugly as soon as you have more than 2 expressions on one side of the ","), or having luck (I think for example that 5->Br1->A does put 5 in B and r1 in A even without a newline, but that wouldn't work if you replaced r1 with C since it would read "BC" as one variable name), but otherwise this kind of stuff isn't supposed to be possible.
So just use this for one single command each time to prevent it from getting really ugly? ^^

I'm gonna read through that piece of code of yours the next time, it's too much for this evening ^^ (I guess sunday since I'm gonna be away for a couple of days ^^)
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Hayleia

Quote from: DJ Omnimaga on August 31, 2016, 05:29:32 PM
That last line reminds me Javascript O.O. Even Z80 ASM looks more readable lol. That said, CE Textlib could get really confusing too because it's all numbers XD
Well I obviously did it on purpose on that line :P
All other lines (not counting comments) are under 140 characters (counting indentation), and most "long" lines are If lines with several conditions, so they're obviously longer.

And I don't think it's weird that ASM would be more readable since I wrote most stuff in an "ASM order" but without an ASM syntax. For example:

...+RandPM128()min(max(,~°MaxV)^^r,°MaxV)^^r->r4

I wrote the "..." then the RandPM128() then the min(max(,... instead of putting everything in the first argument of the max, because that's the order the operations will be done in. That's the order an equivalent ASM code would have. But it's not written in ASM so it's normal to be like "why tf is the first argument of max before max instead of inside?" :P

Quote from: E37 on August 31, 2016, 05:48:43 PM

If {r3-1} and °RightLedge!=0

Wait... You can use "!" outside of If statements?
Erm, well that's "text code", so "!=" is the "not equal" sign. Same as "^^r" which is just the superscript r, not two hats and an r :P

Quote from: p2 on August 31, 2016, 08:41:56 PM
So just use this for one single command each time to prevent it from getting really ugly? ^^

I'm gonna read through that piece of code of yours the next time, it's too much for this evening ^^ (I guess sunday since I'm gonna be away for a couple of days ^^)
Depends what you find ugly and what you find bearable. If you prefer using a "useless" Select rather than wasting lines replacing your "?" with an If (and an End obviously), you can do it. If on the contrary you find it obfuscating, you can also not use it :P

Dream of Omnimaga

To be honest, if my code was gonna become this hard to decipher while also using ASM order, then I would rather retry learning some ASM so I can use inline ASM in my games. But I try to keep my code as readable as possible when I can now.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Hayleia

Quote from: DJ Omnimaga on September 03, 2016, 05:49:53 AM
To be honest, if my code was gonna become this hard to decipher while also using ASM order, then I would rather retry learning some ASM so I can use inline ASM in my games. But I try to keep my code as readable as possible when I can now.
Same, and that's what I've been advising all the time in that thread rather than saying "ok, here's what your code should look like when you're a pro" and no one can read it again. I only made that one line completely unreadable because I was bored at the time, and it was in a game no one cared about (just a contest entry) :P

E37

Have you ever tried to understand greylib? That's impossible to read!
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

Dream of Omnimaga

  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

E37

GreyLib for Axe? it is in Axe.
(This thread should be renamed to like general Axe discussion...)
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

c4ooo

Greylib is in axe but uses inline asm. Anyways a longtime ago I just  took all the asm out of greylib and put it in my own graphics lib so I had a better understanding of what was going on :P

p2

@E37:
I just returned from a lil vacation so I didnt have the time to read through all of your posts yet (sorry for that).
But actually it's somehow still about my little (once super crappy - now more like "rather crappy") axe code and I'm soon gonne upload a re-re-re-written version of it ;) ^^
But I admit it's also some kind of general axe discussion thread ;D
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

E37

I was actually going to make a post on optimization in a bit.
You might want to hold off for a bit.
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

Dream of Omnimaga

Quote from: E37 on September 03, 2016, 07:07:25 PM
GreyLib for Axe? it is in Axe.
(This thread should be renamed to like general Axe discussion...)
Aren't Axioms written in ASM as a mean to enhance the Axe language, though? I thought they were like Celtic, xLIB, Omnicalc and DCS Basic libs
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

E37

GreyLib is a library. Axe has two types of includes Axioms (which are written in Asm) and Libraries which are written in Axe.
Libraries are meant for things Axe can already do like greyscale.
Axioms add completely new things like reading the VAT, running programs and more.
Libraries need to be compiled. Axioms already are.
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

c4ooo

Basicly in the end axioms add commands *as tockens*, while a library is just normal axe code that gets compiled by the axe parser. For example the memkit axiom renames the token Xmin (iirc) to Print( and gives it, as well as the token "dim(" functionality. Meanwhile greylib isn't an axiom and functions are called by typing out there full name. (Ex. GLOAD(), GUNLOAD()). Libraries are a lot more versatile then axioms, but when you don't need that versatility it is nice to add commands natively, as axioms do.

Dream of Omnimaga

Weird, I was sure graylib was ASM, since it can generate perfect grayscale.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Powered by EzPortal