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 2 Guests are viewing this topic.

p2

#15
Quote from: Hayleia on March 27, 2017, 08:29:37 AM
  • 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
Erm.... ::) Only a little bit I did  :thumbsup:

is this way of writing code really faster than a regular display output using a string...?  O.O
(if it is, how big would be the speed differences)

or did u only mean that speed-optifined code is ugly to read as well?
(I can hardly imagine ur above code to be faster than regular code)
  • 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

No, it's obviously not faster (nor smaller) than just a ClrHome and a Disp. I meant that
- readability is not the goal when people optimize
- readability is not my goal when writing unreadable code on purpose (obviously)
But these cases are not the same case, my unreadable code here isn't optimized. It's just unreadable. Optimization often makes code unreadable, but unreadability not often makes code optimized :P

Snektron

The only thing i dont get is how you actually print the value, or does (x)() work on bcalls? Other than that you might be able to compress it with smc
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Hayleia

Quote from: Snektron on March 27, 2017, 08:56:49 AM
The only thing i dont get is how you actually print the value, or does (x)() work on bcalls? Other than that you might be able to compress it with smc
It does not as far as I know. And I already use smc :P

c4ooo

Quote from: Hayleia on March 27, 2017, 12:01:08 PM
Quote from: Snektron on March 27, 2017, 08:56:49 AM
The only thing i dont get is how you actually print the value, or does (x)() work on bcalls? Other than that you might be able to compress it with smc
It does not as far as I know. And I already use smc :P
We need more hints :3

p2

cangrats on making an axe code not even other pretty good axe devs can read  :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: c4ooo on March 28, 2017, 03:32:46 AM
We need more hints :3
Ah come on, you can't give up now :P
You already found out what /() meant (you missed its special case but still, if you understand that even without the special case, you can understand 90% of the program... plus, the special case is easy to find and quick to test) and noticed the use of (foo)(), so really, you can at least transform that unreadable Axe code into a readable Axe code (I mean with numbers :P). Then you'll need basic Asm skills to progress but we're not there yet (and if you're not into Asm, anyone who is can help, it's really basic).

novenary

Quote from: Hayleia on March 27, 2017, 08:29:37 AM
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.
Also keep in mind that these languages have much, much better compiler optimizations than what Axe is capable of, especially considering the increased complexity of modern architectures.

Quote from: Hayleia on March 27, 2017, 08:29:37 AM
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.
I think you're overestimating the quality of corporate code by a long shot. :trollface:

Snektron

Okay, so i count 8 pairs of ->{x}^^r. That means you wrote 16 bytes, im guessing:
0xEF, 0x45, 0x0A, H, e, l, l, o, , w, o, r, l, d, 0x00
Also known as

    bcall(_PutS)
    ret
.db "Hello world", 0

You probable wrote them to saferam or something, which means after writing you probably call the address where you wrote your code.
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Hayleia

Quote from: Streetwalrus on March 28, 2017, 08:28:14 AM
I think you're overestimating the quality of corporate code by a long shot. :trollface:
Nope, I've seen it :P
But it's just the "wait what?" type of code, not brainf*ck type of code on purpose.

Quote from: Snektron on March 28, 2017, 08:52:17 AM
Okay, so i count 8 pairs of ->{x}^^r. That means you wrote 16 bytes, im guessing:
0xEF, 0x45, 0x0A, H, e, l, l, o, , w, o, r, l, d, 0x00
Also known as

    bcall(_PutS)
    ret
.db "Hello world", 0

You probable wrote them to saferam or something, which means after writing you probably call the address where you wrote your code.
Ah, another challenger :D
Well, this would lack a ld to load the address of the string (plus PutC only puts one character, but just change that bcall and you can write a string for the same amount of bytes).
But glad you noticed there were a lot of __->{__}^^r, combine that with what @c4ooo finds as number values (values stored, addresses stored to, addresses called) and you could understand everything, for real.

Snektron

The load of the address would be one of your weird formulas ofcourse. Also thats PutS, not PutC ;)
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Hayleia

Quote from: Snektron on March 28, 2017, 10:22:39 AM
The load of the address would be one of your weird formulas ofcourse.
That could definitely have been possible indeed. And probably much smaller in the case of the Hello World. Not sure about other cases (longer strings).

Quote from: Snektron on March 28, 2017, 10:22:39 AM
Also thats PutS, not PutC ;)
Sorry, I had problems reading your code. Too many alphanumeric characters and not enough operators and parentheses :trollface:

novenary

Let's start by formatting this a little, so we can see clearer.
Now, for the edge case of /() that you mentioned, it's simply that if HL is 0, the result will be 65535. So the first two in the program ensure that we start at 1.
So now we can already see that each +() will double HL, +(+()) will triple, etc. *() is square, +(/()) is +1 (or -1 if HL==0), and so forth. I can't actually find more than two levels of parenthesis nesting, so that will simplify things a little. Brb writing a quick python script. :P

p2

Quote from: IRC*   Walrified post by Streetwalrus on Re: Having some fun, you can join too https://codewalr.us/1965/54822   17:23:27
Streetwal   I cracked the code  :P   17:24:19
JWinslow23   How insane ARE you?   17:26:53
pretty much sums it ip  :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: Streetwalrus on March 29, 2017, 03:23:26 PM
Let's start by formatting this a little, so we can see clearer.
Now, for the edge case of /() that you mentioned, it's simply that if HL is 0, the result will be 65535. So the first two in the program ensure that we start at 1.
So now we can already see that each +() will double HL, +(+()) will triple, etc. *() is square, +(/()) is +1 (or -1 if HL==0), and so forth. I can't actually find more than two levels of parenthesis nesting, so that will simplify things a little. Brb writing a quick python script. :P
Yes everywhere :P
Especially about the python script :trollface:

Except maybe about the formatting. I'm not so sure I find this more readable. The only thing I would have done to make it more readable is putting the __->{__}^^r on separate lines rather than all on one.

Powered by EzPortal