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

[Axe] Having some fun, you can join too

Started by Hayleia, March 25, 2017, 10:57:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hayleia

I had that idea when one too many person said that Axe was intrinsically unreadable (even though nope, a "noob's" Axe is as readable as a "noob's" Basic, and an "expert's" Axe is as unreadable as an "expert's" Basic, it's just that many more Axe programmers were into optimization, thus making more unreadable Axe programs than unreadable Basic programs).

Anyway, here's the source for a Hello World.

.AA
/()/()+(+())*()+()*()+(+())+(/())+(+(+())+())+(/())+(+())+(+())+(/())->{/()/()+()+(+())*()+(+())*()+(+())}^^r/()/()+()*()+(+())+(/())*()+(+())+(+()+())+(/())+(+(+())+())->{/()/()+(+())*()+()*(*())+(+())+(/())+()}^^r/()/()+(+())*()+()*()+(+())+(/())+(+(+())+())+(/())+(+())+(+())->{/()/()+(+())*(*())+()*()+(+())+(/())+()+()}^^r/()/()+()+(+(+())+())*()+(/())+()+(+())+(+()+())+(/())+(+())+(/())->{/()/()+(+())*()+()*(*())+(/())+()+(+())}^^r/()/()+()*()*()*(*())+(/())+(/())+(/())+(+(+()+())+())->{/()/()+(+()+())*()+()*()+()+(+(+())+())}^^r/()/()+()+(+()+())*()+()+(/())+()+(/())+()+()+()+()+(/())+()+()+()->{/()/()+(+()+())*()+()*()+(+(+())+())+(/())+()}^^r(/()/()+()+(+())*()+(+())*()+(+()))()
/()/()+(+())*(*())+(/())+(/())*()+(+())+(/())+(+(+())+())->{/()/()+(+())*()+()*(*())+(+())+(/())+()}^^r/()/()+(+())*(*())+(/())+(/())*()+(+())+(/())+(+(+())+())->{/()/()+(+())*()+()*(*())+(/())+()+(+())}^^r/()/()+()+(+())*()+(+())*()+(+())
()(/()/()+()+(+())*()*()+(+()+())+(/())+(/())+()+())
()(/()/()+()*()*()*()+(/())+()+()+(+())+(+())+(+()))
()(/()/()+()+(+())*()+(/())+()+()+()+()+(/())+()+(+(+())+())+(/()))
()(/()/()+(+()+())*()+(+())+(/())+(+()+())+(+()+())+(+()+())+(/())+(+()))
()(/()/()+()*()*()*()+(/())+()+(+())+(+())+(/())+()+(+()))
(+(/()+()+()))(/()/()+()*()*()+()+(+()+())*())



The challenge is to produce the same output but with a smaller program... and obviously without using any other character than the ones already in use (not counting ".AA") :P
Note, -> is the sto arrow, and ^^r is the superscript r.

For those who would like the 8xp directly for the source, you can download it here.

Snektron

I'm having vietnam flashbacks to that one javascript program that did the same.
Is that all on the same line btw?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


c4ooo

Huh, how does this even work, i don't even see a "disp" >_>

Yuki

Reminds me of how JSc works. So it works too in Axe or it's something else?
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

novenary


Ranman

  • Calculators owned: TI-89 HW1, TI-92+, Casio 9860G Slim, Casio fx6300, Tandy PC7
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

Hayleia

Quote from: Snektron on March 26, 2017, 12:31:32 AM
I'm having vietnam flashbacks to that one javascript program that did the same.
Is that all on the same line btw?
No, it's 9 lines. And actually, putting them on the same line makes the program crash :P

Quote from: c4ooo on March 26, 2017, 12:47:00 AM
Huh, how does this even work, i don't even see a "disp" >_>
HAxe

Quote from: Juju on March 26, 2017, 01:02:52 AM
Reminds me of how JSf*** works. So it works too in Axe or it's something else?
Of course here I'm not playing with arrays and types since Axe has neither of both :P
But it's kind of the same idea yeah.

Quote from: Streetwalrus on March 26, 2017, 01:14:38 AM
Nice one. Reminds me of this.
Not impressed. I still see print and chr :trollface:

Quote from: Ranman on March 26, 2017, 01:40:30 AM
Break out the punch cards. :w00t:
Sorry about that but I have no idea what you mean. Might be because I'm French and you're using some idiom we don't learn in schools.

JWinslow23

Hayleia, punch cards used to be (as the name implies) cards you punch holes in, used in the old (no, older than that) days of computers for data input, data output, data storage, and (most esoterically) programming.

Also lol at your Axe source. What the heck is going on there?

p2

Yeah I remember the good old punchcards had to carry a hundred of them around for the most simple programs, and if you dropped them and messed up their order, you were basically screwed.
My father used to learn programming with them ^^

@Hayleia: those thick paper cards with holes in them, I'm sure you know them :)

Also wow, have fun debugging such a code x.x
  • 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)

WholeWheatBagels

Living in another world to you.



Also in case you were wondering Frankie did go to Hollywood

c4ooo

#10
() basically returns the previous value of HL, so you can do something like /() which would be HL/HL and thus one.
(foo)() also calls the address of foo.

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

Hayleia

@Ranman @p2 @JWinslow23 Ok about the punch cards, but I still have no idea about "Break out" :P

Quote from: p2 on March 26, 2017, 10:17:23 AM
Also wow, have fun debugging such a code x.x
No need to debug it when it works at first try.
(lol)

Quote from: c4ooo on March 26, 2017, 06:56:45 PM
() basically returns the previous value of HL, so you can do something like /() which would be HL/HL and thus one.
(foo)() also calls the address of foo.
Ah, finally a challenger :D
You're right about routine calling. And you're half right about your first sentence :P
/() is often one, but not always. Though it does not always matter, depending on what's next.

p2

then I have one last question @Hayleia:
Why?
Why on earth would you ever want to write a code like that???
writing such terribly ugly code should be considered a crime against humanity :ninja:
  • 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: p2 on March 27, 2017, 07:35:06 AM
then I have one last question @Hayleia:
Why?
Why on earth would you ever want to write a code like that???
For several reasons, more or less important.

  • I was bored. Now my Wii U is back so I "released" this without working too much on it so I am really 100% sure it can be improved drastically
  • I wanted to code something in C++ and to get my TI-dev environment on my "new" linux partition. Yeah, of course that code is generated, did you really think I wrote that all by hand? :P
  • and the last one is a longer reason, and it's actually what I wrote in the first post. Axe isn't less readable than Basic. On the contrary, it's a language that supports indentation, functions and custom names for variables (instead of just A-Z) so it's intrinsically more readable than Basic...
    Except that some people take my Axe, matref's Axe and Runer112's Axe as an example for what all Axe programs look like. But nope, that's not what all Axe programs look like. If you want readable Axe, you can get it. Have a look at SSBO's source, you'll understand everything except the main menu. And have a look at Weregoose's Basic. You don't understand one line of his one liners.
    What this means is that Axe and Basic can become unreadable when the dev doesn't care about readability. Like when they try to optimize for speed/memory, or when they do it on purpose like what I just did. And it doesn't mean these languages are intrinsically unreadable. On the contrary, more Axe devs got their Axe programs to be optimized because thanks to indentation, functions and custom variables, they were still more understandable than an optimized Basic program's seq/cumSum/linearReg(ax+b) unindented lines using one-character variables only.

    And another invalid argument is like Axe vs Lua or Axe vs C++ or Axe vs Java or whatever. Because Lua, C++ and Java don't run on 6MHz z80s. So you don't need to optimize anything and you can keep your code readable. If you had to run Java on a z80, you'd end up writing bytecode, so it would be less readable than any Axe code and still slower.

    So yeah, that was kind of my rant and action about that :P

Quote from: p2 on March 27, 2017, 07:35:06 AM
writing such terribly ugly code should be considered a crime against humanity :ninja:
Not as long as I do it on purpose. If a company used Axe as their language for a product (lol) and I wrote such ugly code, yeah, I'd understand I'd get fired.

Powered by EzPortal