Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Freyaday on July 05, 2011, 05:00:15 am

Title: Axing your mind
Post by: Freyaday on July 05, 2011, 05:00:15 am
Let's start a little game.
Let's see who can come up with the most brain-bending legal line of code in pure Axe that does not crash the calculator.
The winners are those whose code cannot be deciphered by anyone else.
Title: Re: Axing your mind
Post by: AngelFish on July 05, 2011, 05:07:36 am
I predict Runer will win this hands down...
Title: Re: Axing your mind
Post by: ZippyDee on July 05, 2011, 05:18:10 am
Asm(barrage of hex)
Title: Re: Axing your mind
Post by: Freyaday on July 05, 2011, 05:33:24 am
Note: Pure Axe means without the use of Assembly
Title: Re: Axing your mind
Post by: ZippyDee on July 05, 2011, 05:34:17 am
AWWWWWWWWWWWW D:
Title: Re: Axing your mind
Post by: AngelFish on July 05, 2011, 05:42:12 am
Okay, this compiles and doesn't crash:

{°A}+(X^3°port+9[30]#Realloc(°W){°r1*6,2[23]}+°Θport→{{A}r}
Title: Re: Axing your mind
Post by: ZippyDee on July 05, 2011, 05:47:14 am
HOLD UP A SECOND
The winners are those whose code cannot be deciphered by anyone else.
Does this mean that you have to be able to decipher it yourself?
Title: Re: Axing your mind
Post by: TIfanx1999 on July 05, 2011, 06:19:12 am
I would think so, yes.
Title: Re: Axing your mind
Post by: ZippyDee on July 05, 2011, 06:19:54 am
Yes, it was confirmed: You must be able to decipher your code, because you have to be able to tell people if they are wrong.
Title: Re: Axing your mind
Post by: Freyaday on July 05, 2011, 06:20:05 am
It does, that way you can tell us if we get your code's function wrong.
Zippy beat me to it.
Title: Re: Axing your mind
Post by: yunhua98 on July 05, 2011, 10:38:01 am
Okay, this compiles and doesn't crash:

{°A}+(X^3°port+9[30]#Realloc(°W){°r1*6,2[23]}+°Θport→{{A}r}
I give up.  :P  I can't even understand most other people's game codes,  much less a messed up code that doesn't do much.  :P
Title: Re: Axing your mind
Post by: Ashbad on July 05, 2011, 12:27:59 pm
Okay, this compiles and doesn't crash:

{°A}+(X^3°port+9[30]#Realloc(°W){°r1*6,2[23]}+°Θport→{{A}r}

Stores the bottom 8 bits of A in HL, pushes HL, takes the value of X mod 3 and puts in HL, attempts to find the address of symbol port but resolves to nothing, adds 9, adds $30 to the .data section of the program, reallocated the standard variables so that A corresponds to W, B corresponds to X, etc., pushes HL, gets the address of the var r1*6, puts 2 in HL, adds $23 to the .data section of the program, pops HL, adds the address of the var theta, takes the state of the link port and stores to the byte pointed to by the short pointed to by the value of A.  Whew :)

My turn my turn!  :D

({{rand+nib{8/cos(SQRT(rand20)+8erandrand)16BITANDsin(->F)}}->{°Θ}r/{EFFFF xor L1))}16BITXOR{->{°C-4}rr°A+{Trand*85+rand^°C}}r}//{rand+L1}2)**{F} and {5max(,)5}

Edit: I'll admit when I wrote this I had no idea what °port would correspond to.  My theory is that it basically would result to returning nothing, ignore the port and simply preserve HL, or even possibly returning the address of the embedded "port" function added to the .text portion of the program.  With a quick test, I realized this wont even compile just because of those two tokens :P.  So, without that, it's working code -- and I stick by everything else I described in function.
Title: Re: Axing your mind
Post by: ZippyDee on July 05, 2011, 02:49:13 pm
Ashbad what does having a comma in {} do? Qwerty's has that....
Title: Re: Axing your mind
Post by: Ashbad on July 05, 2011, 03:24:22 pm
It'll basically apply the dereferencing of the { } to the equation on the left hand of the comma into HL, and the expression on the right is subsequently executed like normal.  Therefore, {5,6} basically means {5}:6.  Though, it doesn't seem to always compile :P.  However, when you can get it to do so, that's what it'll represent.

Edit: it'll always compile though if you leave out the ending }, I found.  {5,6: compiles consitantly and works like I described.
Title: Re: Axing your mind
Post by: ZippyDee on July 05, 2011, 03:39:22 pm
Interesting.....................................................Good to know!
Title: Re: Axing your mind
Post by: Freyaday on July 05, 2011, 04:13:42 pm
Huh. Perhaps Axe is parsing the , as a }
Title: Re: Axing your mind
Post by: Quigibo on July 05, 2011, 04:18:12 pm
Fixed the bug, it was simply skipping over it by mistake thinking it was }.

By the way, another syntax obfuscation you can do is that Axe doesn't usually differentiate between } and ) so you can sometimes use them interchangeably.  Sometimes you can't though, especially with r modifiers.  Try this: sin(5}
Title: Re: Axing your mind
Post by: Freyaday on July 05, 2011, 10:38:16 pm
Good to hear, Quigibo! The first part is anyway. *.*
sqrt(X2+Y2->{{{ºD-I}r}+sin(5}}
Title: Re: Axing your mind
Post by: Broseph Radson on July 05, 2011, 10:43:44 pm
 O.O
good lord i dont stand a chance here...
Title: Re: Axing your mind
Post by: XVicarious on July 06, 2011, 01:50:19 am
Good to hear, Quigibo! The first part is anyway. *.*
sqrt(X2+Y2->{{{ºD-I}r}+sin(5}}

Taking a wild guess here:
Its taking the square root of X^2+Y^2 and storing it to the position of D-I, plus the sine of 5?
Title: Re: Axing your mind
Post by: fb39ca4 on July 06, 2011, 02:02:06 am
Interesting...an obfuscated Axe mini-contest would be cool to see, working similarly to the International Obfuscated C Contest (http://www0.us.ioccc.org/main.html)
Title: Re: Axing your mind
Post by: Ashbad on July 06, 2011, 10:50:55 am
Good to hear, Quigibo! The first part is anyway. *.*
sqrt(X2+Y2->{{{ºD-I}r}+sin(5}}

Taking a wild guess here:
Its taking the square root of X^2+Y^2 and storing it to the position of D-I, plus the sine of 5?

Not quite ;)

It's taking the square root of X squared + Y squared and loading it in the byte pointed to by the sine of 5 plus the byte pointed to by the short pointed to by the address of D minus the value of I.  Close :)

No one is gonna try mine? :'(
Title: Re: Axing your mind
Post by: Freyaday on July 06, 2011, 01:53:11 pm
All y'all are wrong about mine.
Spoiler For Hint:
Note missing )
Title: Re: Axing your mind
Post by: ZippyDee on July 06, 2011, 03:19:17 pm
so it's not valid...
Title: Re: Axing your mind
Post by: Freyaday on July 06, 2011, 04:05:24 pm
Oh, it's perfectly valid.
Title: Re: Axing your mind
Post by: Ashbad on July 06, 2011, 04:43:09 pm
Oh, it's perfectly valid.

Well then I'm correct :P
Title: Re: Axing your mind
Post by: Freyaday on July 06, 2011, 05:27:52 pm
Oh, it's perfectly valid.

Well then I'm correct :P
No. Remember that -> doesn't close all open parentheses in Axe. Remember where Axe closes open parentheses. Remember....
Title: Re: Axing your mind
Post by: FinaleTI on July 06, 2011, 05:31:00 pm
Then perhaps it does what Ashbad says, but it square roots everything last instead of first?
Title: Re: Axing your mind
Post by: Freyaday on July 06, 2011, 05:31:48 pm
Then perhaps it does what Ashbad says, but it square roots everything last instead of first?
Still no.
Title: Re: Axing your mind
Post by: Runer112 on July 06, 2011, 06:23:53 pm
({{rand+nib{8/cos(SQRT(rand20)+8erandrand)16BITANDsin(->F)}}->{°Θ}r/{EFFFF xor L1))}16BITXOR{->{°C-4}rr°A+{Trand*85+rand^°C}}r}//{rand+L1}2)**{F} and {5max(,)5}

This code is not valid Axe code. You have mismatched parentheses:

Depth: 0123        4     5    6      5          4           5   432  3  2 3           210
        ({{rand+nib{8/cos(SQRT(rand20)+8erandrand)16BITANDsin(->F)}}->{°Θ}r/{EFFFF xor L1))}    continued below...
Depth:          1  2    1     2               10 -1
        16BITXOR{->{°C-4}rr°A+{Trand*85+rand^°C}}r}//{rand+L1}2)**{F} and {5max(,)5}



sqrt(X2+Y2->{{{ºD-I}r}+sin(5}}


Alternatively, as one run-on sentence:

Attempt, but fail because flash is read-only, to store the low byte of x squared plus y, squared to the byte pointed to Axe's approximation of 127 times the sine of 5 binary degrees, which is 19, plus the byte pointed to the word pointed to the address of the D variable offset backwards in memory I bytes, and finally take the square root of the address to which x squared plus y, squared was attempted to be stored, giving a final value of 4 to 16.
Title: Re: Axing your mind
Post by: Freyaday on July 06, 2011, 06:50:45 pm
Close, but you're forgetting Axe's order of operations
Title: Re: Axing your mind
Post by: ztrumpet on July 06, 2011, 06:52:35 pm
Well, it's (X2+Y)2, but I think Runer thought it was so obvious that he didn't mention it. ;)
Title: Re: Axing your mind
Post by: Runer112 on July 06, 2011, 06:55:19 pm
Change anywhere I said "x squared plus y squared" to "x squared plus y, squared." The comma is important to include I guess.
Title: Re: Axing your mind
Post by: Freyaday on July 06, 2011, 07:19:48 pm
Yes, commas are important.
Title: Re: Axing your mind
Post by: JustCause on July 06, 2011, 08:13:21 pm
The hardcore ASM discussions on #omnimaga have been making me feel stupid, but they are NOTHING compared to this. Seriously, what the.../me lies down
Title: Re: Axing your mind
Post by: ztrumpet on July 06, 2011, 08:55:57 pm
The hardcore ASM discussions on #omnimaga have been making me feel stupid, but they are NOTHING compared to this.
...but I love sitting in on those discussions and feeling stupid... :'(
Title: Re: Axing your mind
Post by: Quigibo on July 06, 2011, 09:43:11 pm
The new rule should be that your code must perform something useful, perhaps in a roundabout or inefficient way.  But it shouldn't just be a bunch of random garbage because there is no fun in trying to decipher something that has no meaning in the end.
Title: Re: Axing your mind
Post by: Freyaday on July 06, 2011, 10:00:04 pm
What Quigibo said.
Quigibo, you know Axe best, can you be the judge of that?
Title: Re: Axing your mind
Post by: Munchor on July 07, 2011, 06:41:56 am
I personally think that {°A}+(X^3°port+9[30]#Realloc(°W){°r1*6,2[23]}+°Θport→{{A}r} was hard enough for me :P But it was deciphered :)