Author Topic: yeongJIN_COOL's Universal base converter  (Read 6172 times)

0 Members and 1 Guest are viewing this topic.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
yeongJIN_COOL's Universal base converter
« on: March 28, 2011, 07:32:27 pm »
Well, this is TI-BASIC program, so no requirements are needed. :D
I didn't see any program like this in here, so I post it.
This nifty program lets you convert any base number to any base(2~36).
Posted screenshot also.
« Last Edit: March 29, 2011, 07:07:52 pm by Qwerty.55 »
Sig wipe!

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: yeongJIN_COOL's Universial base converter
« Reply #1 on: March 29, 2011, 05:02:56 pm »
Well, this is TI-BASIC program, so no requirements are needed. :D
I didn't see any program like this in here, so I post it.
This nifty program lets you convert any base number to any base(2~36).
Posted screenshot also.

I think Deep Thought made one like that but homescreen (like you could do maths with it, I think), but this is very good, nice job Yeong.

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: yeongJIN_COOL's Universial base converter
« Reply #2 on: March 29, 2011, 05:11:10 pm »
Awesome.  ;)  Just a little thing, its spelled "Universal"  ;)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: yeongJIN_COOL's Universial base converter
« Reply #3 on: March 29, 2011, 05:13:04 pm »
Well, this is TI-BASIC program, so no requirements are needed. :D
I didn't see any program like this in here, so I post it.
This nifty program lets you convert any base number to any base(2~36).
Posted screenshot also.

I think Deep Thought made one like that but homescreen (like you could do maths with it, I think), but this is very good, nice job Yeong.
DT's only did bases 2,8,10 and 16. Though I guess bases other than 2,10 and 16 are really for fun, since those three are often the bases programmers use (though I guess some might use octal...). Still, looks great Yeong!
« Last Edit: March 29, 2011, 05:13:47 pm by FinaleTI »


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: yeongJIN_COOL's Universial base converter
« Reply #4 on: March 29, 2011, 05:33:14 pm »
Well, this is TI-BASIC program, so no requirements are needed. :D
I didn't see any program like this in here, so I post it.
This nifty program lets you convert any base number to any base(2~36).
Posted screenshot also.

I think Deep Thought made one like that but homescreen (like you could do maths with it, I think), but this is very good, nice job Yeong.
DT's only did bases 2,8,10 and 16. Though I guess bases other than 2,10 and 16 are really for fun, since those three are often the bases programmers use (though I guess some might use octal...). Still, looks great Yeong!

Oh yeah, universal bases, Deep's doesn't have it.
Also, Universal* :P
« Last Edit: March 29, 2011, 05:33:29 pm by Scout »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: yeongJIN_COOL's Universial base converter
« Reply #5 on: March 29, 2011, 06:49:32 pm »
Nice, that's pretty cool. I got bored and went though and optimized it and shaved off 31 bytes.

Spoiler For Sorry Chrome Users:
Code: [Select]
ClrHome
Disp "yeongJIN-COOL'S","Universal","Base Converter","
Pause "Press Enter
ClrHome
Input "TYPE NUM ",Str1
Input "BASE OF NUM ",A
Input "BASE TO CONVERT ",Y
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str0
DelVar Xlength(Str1→B
For(D,1,A
If Str2=sub(Str0,D,1
D→E
End
X+(E-1)A^(C-1→X
End
"_→Str2
If not(X
"0→Str2
While X
sub(Str0,X-YiPart(X/Y)+1,1)+Str2→Str2
iPart(X/Y→X
If Ans<Y
Then
sub(Str0,Ans+1,1)+Str2→Str2
DelVar X
End
End
DelVar ADelVar BDelVar CDelVar DDelVar EDelVar XDelVar YDelVar Str0DelVar Str1Disp "RESULT",Str2

There are other optimizations that I missed I'm sure since I'm out of practice sort of. You can obviously shave off more if you take out the lowercase letters. It's a nice program though.
Spoiler For Spoiler:



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

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: yeongJIN_COOL's Universal base converter
« Reply #6 on: March 29, 2011, 07:09:15 pm »
Awesome.  ;)  Just a little thing, its spelled "Universal"  ;)

Fixed just because multiple people have pointed it out...

Also, uprated the OP. That's a nice program. Does it handle decimals as well?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: yeongJIN_COOL's Universal base converter
« Reply #7 on: March 29, 2011, 07:12:15 pm »
I don't think so since it's completely string oriented and there wasn't any code to hand a period.
Spoiler For Spoiler:



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

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: yeongJIN_COOL's Universal base converter
« Reply #8 on: March 29, 2011, 07:13:01 pm »
:(
* Qwerty.55 likes converting decimals
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Ashbad

  • Guest
Re: yeongJIN_COOL's Universal base converter
« Reply #9 on: March 29, 2011, 07:13:52 pm »
^-^ looks very nice, yeong :)

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: yeongJIN_COOL's Universal base converter
« Reply #10 on: March 29, 2011, 08:06:43 pm »
Awesome.  ;)  Just a little thing, its spelled "Universal"  ;)

Fixed just because multiple people have pointed it out...

Also, uprated the OP. That's a nice program. Does it handle decimals as well?
Yes, Decimal works as well.
Sig wipe!

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: yeongJIN_COOL's Universal base converter
« Reply #11 on: March 29, 2011, 08:09:37 pm »
I believe he means decimal as in real numbers, not just integers.
« Last Edit: March 29, 2011, 08:10:00 pm by meishe91 »
Spoiler For Spoiler:



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

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: yeongJIN_COOL's Universal base converter
« Reply #12 on: March 29, 2011, 08:10:49 pm »
oh. It doesn't. XP
If someone tell me how to convert decimals, i can fix that....XD
Sig wipe!

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: yeongJIN_COOL's Universal base converter
« Reply #13 on: March 29, 2011, 08:24:21 pm »
It's not terribly difficult to do. For example, let's try something like 10.5
To convert this to binary, convert the 10 as normal (1010) and then we'll deal with the decimal. Now, decimals in binary are calculated like this: every nth decimal place after the period is calculated as 1/2n. Since .5 is equal to 1/21, it's equal to 0.1
Add this to the integer and you have your binary decimal 1010.1

:)
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline phenomist

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 132
  • Rating: +46/-3
    • View Profile
Re: yeongJIN_COOL's Universal base converter
« Reply #14 on: March 29, 2011, 08:34:36 pm »
Now that we're talking about base converters, here's my converter from around October 2010 or so.

Sorry for invading your thread :P

It currently has support for base 2 to 62 (with lowercase), and also has support for decimals and fractions (e.g. say you want to know 1/13 in binary).
Level Designer for Graviter

[Disclaimer: I can't program for my life.]