Author Topic: Extra Detail Suite  (Read 8874 times)

0 Members and 3 Guests are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Extra Detail Suite
« Reply #30 on: March 03, 2011, 01:16:42 pm »
No, I didn't test it, but I have made enough base converters that I am pretty sure that should work :)

SirCmpwn

  • Guest
Re: Extra Detail Suite
« Reply #31 on: March 03, 2011, 01:17:57 pm »
If you look at my last edit, I explain why it wont actually work :(

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Extra Detail Suite
« Reply #32 on: March 03, 2011, 01:21:35 pm »
Ah, okay... *oops*

SirCmpwn

  • Guest
Re: Extra Detail Suite
« Reply #33 on: March 03, 2011, 01:39:20 pm »
Optimized to within an inch of its life:
Code: [Select]
Ans→A
Ans<0
sub(" -",1+Ans,1→Str0
abs(A→A
While A
sub("0123456789",A-10int(.1A)+1,1)+Str0→Str0
int(.1A→A
End
sub(Str0,1,length(Str0)-(1=inString(Str0,"
« Last Edit: March 03, 2011, 01:41:57 pm by SirCmpwn »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Extra Detail Suite
« Reply #34 on: March 03, 2011, 01:43:03 pm »
I thought of that with the negative sign, too, but then I realised it put the negative at the end...

SirCmpwn

  • Guest
Re: Extra Detail Suite
« Reply #35 on: March 03, 2011, 01:43:35 pm »
Yeah, I just found that out.  I'm thinking of how to fix it, this is why I originally used Z.
Code: [Select]
Ans→A
Ans<0
sub(" -",1+Ans,1→Str0
abs(A→A
While A
sub("0123456789",A-10int(.1A)+1,1)+Str0→Str0
int(.1A→A
End
If inString(Str0,"-
"-"+Str0→Str0
sub(Str0,1,length(Str0)-1
« Last Edit: March 03, 2011, 01:50:26 pm by SirCmpwn »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Extra Detail Suite
« Reply #36 on: March 03, 2011, 01:53:57 pm »
Ah, that last edit is larger than the original by 15 bytes...

SirCmpwn

  • Guest
Re: Extra Detail Suite
« Reply #37 on: March 03, 2011, 01:56:03 pm »
But it doesn't use Z, which was the goal.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Extra Detail Suite
« Reply #38 on: March 03, 2011, 02:07:05 pm »
Okay, I cannot think of any better ways, and yeah, that makes sense. You save 18 bytes of RAM by not using a real var, so really you lost 3 bytes :D

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Extra Detail Suite
« Reply #39 on: March 03, 2011, 02:38:26 pm »
Original routine using Z: 94 bytes
Routine without using Z: 110 bytes
This routine I just made that doesn't use Z and handles the zero case correctly: 92 bytes :hyper:

Code: [Select]
Ans→A
" →Str0
A
Repeat Ans=0
Ans→A
sub("0123456789",abs(A-10iPart(.1A))+1,1)+Str0→Str0
iPart(.1A
End
Str0
If A<0
"⁻"+Ans
sub(Ans,1,length(Ans)-1

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Extra Detail Suite
« Reply #40 on: March 03, 2011, 02:47:35 pm »
Code: [Select]
Ans→A
" →Str0
A
Repeat not(Ans
Ans→A
sub("0123456789",abs(A-10iPart(.1A))+1,1)+Str0→Str0
iPart(.1A
End
Str0
If A<0
"⁻"+Ans
sub(Ans,1,length(Ans)-1

:P

SirCmpwn

  • Guest
Re: Extra Detail Suite
« Reply #41 on: March 03, 2011, 02:48:51 pm »
* While Ans
:P
« Last Edit: March 03, 2011, 02:49:19 pm by SirCmpwn »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Extra Detail Suite
« Reply #42 on: March 03, 2011, 02:49:28 pm »
But then try zero... :P

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Extra Detail Suite
« Reply #43 on: March 03, 2011, 02:50:10 pm »
Ah right, my TI-BASIC skills are quite rusty so I didn't see that potential for optimizing to not(. But I got the general idea down well. :)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Extra Detail Suite
« Reply #44 on: March 03, 2011, 02:54:44 pm »
Dang it, I had just optimized it but you guys beat me...:P
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)