Author Topic: Encoding eight characters as a single number  (Read 3820 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Encoding eight characters as a single number
« on: October 31, 2011, 07:30:51 pm »
Just wanted to share a little routine I made to store eight bytes of uppercase text as a single real variable (for example for high-score player names).
Operation
Input
Output
Code
Encoding
Str0
Ans
Decoding
J
Str0
« Last Edit: September 23, 2012, 04:22:14 pm by Deep Thought »




Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Encoding eight characters as a single number
« Reply #1 on: October 31, 2011, 07:32:03 pm »
Exactly what I need to finish my BASIC game!!! +1

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Encoding eight characters as a single number
« Reply #2 on: October 31, 2011, 07:33:40 pm »
GIF of it in action, with the actual program:




Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Encoding eight characters as a single number
« Reply #3 on: October 31, 2011, 07:50:03 pm »
This would be awesome for lists, because people are less likely to delete lists than Real Variables

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Encoding eight characters as a single number
« Reply #4 on: October 31, 2011, 07:51:45 pm »
and you can create lists, but you can't create strings!
it all works out!!! ;D

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Encoding eight characters as a single number
« Reply #5 on: October 31, 2011, 07:53:47 pm »
This would be awesome for lists, because people are less likely to delete lists than Real Variables
Yep, that's what I'm doing. A list of just ten elements (ninety bytes) is enough for five names and five high scores :D




Offline GB

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 147
  • Rating: +15/-3
  • Use Microhard WindOS today!
    • View Profile
    • MICROHARD CORPORATION
Re: Encoding eight characters as a single number
« Reply #6 on: December 19, 2011, 04:54:58 pm »
Have you tried storing strings directly into lists?
« Last Edit: December 19, 2011, 04:55:09 pm by GB »
TI-86 USER
CASIO PRIZM USER
TI-NSPIRE USER
TI-84 PLUS SILVER EDITION USER
TI-83 PLUS USER

PROJECTS:

Microhard Paint
http://www.omnimaga.org/index.php?topic=11915.0

TI-Nspire Character Map
http://www.omnimaga.org/index.php?topic=7725.msg142555#msg142555

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Encoding eight characters as a single number
« Reply #7 on: December 19, 2011, 04:56:04 pm »
Why do that when you can store the same string in one-eighth the memory? :D
« Last Edit: December 19, 2011, 04:56:12 pm by Deep Thought »