Author Topic: Funny axe code !  (Read 6633 times)

0 Members and 1 Guest are viewing this topic.

Offline nikitouzz

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 215
  • Rating: +22/-1
    • View Profile
Funny axe code !
« on: June 24, 2013, 08:48:15 pm »
I have found random on thing tape it code :

THIS CODE FREEZE THE CALCULATOR !

:.AAA
:getcalc("appvC",2316)→A
:fill(A,0,2316)

compile in noshelle and execute it code then.... appared on the screen your TI and your OS version :p

someone can explain me ?

PS : I use the 1.1.2 version off Axe !
« Last Edit: June 24, 2013, 08:51:01 pm by nikitouzz »
mes records personels :

2x2x2 : 2.18 secondes / 2x2x2 une main : 21.15 secondes / 2x2x2 yeux bandés : 47.59
3x3x3 : 5.97 secondes / 3x3x3 une main : 49.86 secondes
4x4x4 : 1.49 minutes / 4x4x4 une main : 6.50 minutes
5x5x5 : 4.10 minutes / 5x5x5 une main : 18.02 minutes
6x6x6 : 8.10 minutes
7x7x7 : 16.03 minutes
9x9x9 : 58.26 minutes

megaminx : 5.59 minutes / pyraminx : 7.91 secondes / square-one : 1.07 minutes

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Funny axe code !
« Reply #1 on: June 24, 2013, 08:55:08 pm »
So you're creating an appvar of length 2316, then write 0 bytes at byte 2316 (which is outside the var), hmmm, interesting.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline nikitouzz

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 215
  • Rating: +22/-1
    • View Profile
Re: Funny axe code !
« Reply #2 on: June 24, 2013, 08:56:55 pm »
the reaction of this code is interestly ^^
mes records personels :

2x2x2 : 2.18 secondes / 2x2x2 une main : 21.15 secondes / 2x2x2 yeux bandés : 47.59
3x3x3 : 5.97 secondes / 3x3x3 une main : 49.86 secondes
4x4x4 : 1.49 minutes / 4x4x4 une main : 6.50 minutes
5x5x5 : 4.10 minutes / 5x5x5 une main : 18.02 minutes
6x6x6 : 8.10 minutes
7x7x7 : 16.03 minutes
9x9x9 : 58.26 minutes

megaminx : 5.59 minutes / pyraminx : 7.91 secondes / square-one : 1.07 minutes

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Funny axe code !
« Reply #3 on: June 24, 2013, 11:31:11 pm »
The Axe Documentation states that 0 is not a valid size for the Fill argument. 

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Funny axe code !
« Reply #4 on: June 25, 2013, 12:39:21 am »
Then why doesn't the axe compiler check for that?
I'm not a nerd but I pretend:

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Funny axe code !
« Reply #5 on: June 25, 2013, 12:55:37 am »
There are a million different ways to crash your calc by giving bad arguments to Axe commands, but it's quite difficult to catch them all.  You could definitely check for zero in the case when it is a constant defined, but then you would still run into trouble when it is a variable, which leaves the behavior inconsistent and possibly undesirable.  In the end I imagine it's just really low on the priority list of things to do for Axe.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Funny axe code !
« Reply #6 on: June 25, 2013, 03:16:08 am »
That's actually writing 0 times the /byte/ 2316 at address A. :P And yeah, 0 is not a valid size.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Funny axe code !
« Reply #7 on: June 25, 2013, 03:59:45 am »
It's writing 2316 to the 0 bytes (65536 in fact, that's why Axe says 0 is not a valid size) after A. But I have no idea why it does what you say it does.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Funny axe code !
« Reply #8 on: June 25, 2013, 07:45:02 am »
Then why doesn't the axe compiler check for that?
And why don't programs always check if the user read the readme before running ?

More seriously, that could be a feature for a computer compiler, but here, the compiler works on calc, and already has enough work to do on a 6MHz processor to compile programs in a reasonable time so I guess it is better for it not to check if the user made something that was said in the documentation to crash.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Funny axe code !
« Reply #9 on: June 25, 2013, 09:10:08 am »
It's true. Also, sometimes you want to do some crazy stuff in Axe. If the compiler always checked for perfect syntax, there would be a great deal of stuff you couldn't do.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Funny axe code !
« Reply #10 on: June 25, 2013, 12:33:48 pm »
Then why doesn't the axe compiler check for that?
And why don't programs always check if the user read the readme before running ?
I made such program before for two of my games and it's available in the downloads section as a standalone, but it's written in BASIC, so it would have to be converted to ASM in order to be useable in Axe. :P Even in BASIC it works kinda great, because it checks if a list == 0 before running the game, so the first time you start it, it asks the user a password that is located near the end of the install instructions inside the readme. If you type an incorrect password, it says RTFM, and if you enter it successfully it never asks you again (unless you delete the LN00B list)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Funny axe code !
« Reply #11 on: June 25, 2013, 12:40:28 pm »
Then why doesn't the axe compiler check for that?
And why don't programs always check if the user read the readme before running ?
I made such program before for two of my games and it's available in the downloads section as a standalone, but it's written in BASIC, so it would have to be converted to ASM in order to be useable in Axe. :P Even in BASIC it works kinda great, because it checks if a list == 0 before running the game, so the first time you start it, it asks the user a password that is located near the end of the install instructions inside the readme. If you type an incorrect password, it says RTFM, and if you enter it successfully it never asks you again (unless you delete the LN00B list)
Lol, not bad. I guess that what could also be done in a program with a save feature is, in pseudo-code:

If savegame doesn't exist
   Ask for the password in the readme
   If wrong password
      Display "RTFM"
      End The Game
   Else
      Create the savegame
   End
End

I also thought about another solution, that is not oncalc this time: rename everything in the zip, including extensions, with absolutely unclear names, except the readme. Then the user only has the possibility to read the readme that would reveal what file has to be renamed in. The only reason why I didn't do that is because Windows stupidly hides extensions so noobs would have a hard time renaming files to their extensions.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Funny axe code !
« Reply #12 on: June 25, 2013, 12:47:49 pm »
Yeah that can be another solution as well. However you have to make sure that the linking software people will use is not stupid enough to auto-rename the programs to your newly-created random names when sent on-calc. I know that normally, each program has one internal name of 8 characters, plus a second name for the filename on the computer, but I am unsure if every linking software makes the difference.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Funny axe code !
« Reply #13 on: August 09, 2013, 07:43:35 am »
Another funny code!
Code: [Select]
Asm(C7)RAM CLEARED! (iirc)

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Funny axe code !
« Reply #14 on: August 09, 2013, 08:00:33 am »
Asm(C9)... but nothing happens ! (see what I did there :P).