Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 05:14:18 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: Text compression for AXE programs -  (Read 893 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
gtaforever00
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 25 November, 2011, 11:09:10
Date Registered: 26 October, 2011, 21:01:54
Posts: 10

Topic starter
Total Post Ratings: +4

View Profile
« on: 31 October, 2011, 02:32:36 »
+3

Well I have just been getting a hang of the AXE language and decided my first project is going to be some kind of text compression for my future projects.  I was thinking if you use A thru Z, <space>, <period>, <question mark>, <comma>, <single quote>, <colon>.  That is 32 characters altogether.  You can use 5 bits instead of the 8 bits and therefore saving about 35% space.  If you had 500 characters (500 bytes) and use this theory your total memory usage would be approximately 313 bytes.   What does everybody think?  Would this benefit anybody in their current projects or future ones?  Input would be appreciated thanks.
Logged
epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Today at 04:30:24
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2160


Total Post Ratings: +118

View Profile
« Reply #1 on: 31 October, 2011, 03:12:44 »
0

That would be useful.
Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Yesterday at 09:26:23
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2043


Total Post Ratings: +254

View Profile
« Reply #2 on: 31 October, 2011, 10:00:56 »
0

I was thinking if you use A thru Z, <space>, <period>, <question mark>, <comma>, <single quote>, <colon>.  That is 32 characters altogether.  You can use 5 bits instead of the 8 bits and therefore saving about 35% space.
You forgot something: There is not only A,B,C,... but also a,b,c,... Wink
But yeah, that would be very useful Cheesy (don't forget the decompression algorithm Tongue)
Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
AngelFish
This is my custom title
Administrator
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 00:41:29
Date Registered: 15 August, 2010, 09:18:54
Posts: 3187


Total Post Ratings: +218

View Profile
« Reply #3 on: 31 October, 2011, 10:21:54 »
0

a,b, and c are two byte tokens on-calc. They aren't represented the same as normal ASCII.
Logged

∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ
gtaforever00
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 25 November, 2011, 11:09:10
Date Registered: 26 October, 2011, 21:01:54
Posts: 10

Topic starter
Total Post Ratings: +4

View Profile
« Reply #4 on: 31 October, 2011, 15:40:01 »
0

Well I was also thinking about the lowercase letters, but in reality they just look good and take up more space I must have had too much radiation for breakfast....  I might implement later another version that does more characters if there is enough support, but it will also be less compression too.  I have almost got the compression engine finished Grin.  It looks pretty solid  Frustrated,  I have not had too many bugs in it that were not easily fixable.   Axe is definitilely easier to program in if you look at it like assembly code in a sense but with syntax like basic.
Logged
gtaforever00
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 25 November, 2011, 11:09:10
Date Registered: 26 October, 2011, 21:01:54
Posts: 10

Topic starter
Total Post Ratings: +4

View Profile
« Reply #5 on: 31 October, 2011, 19:06:58 »
0

Well update to the project.  The input for the program is the TI-OS Str1 and the output is Str2.  In the demo program the input string is 162 bytes and the output is 108 bytes.  That is about 33% compression with the strings.  Imagine working on a RPG with 2500 bytes of text,  you compress it 33% that is ~1675 bytes.  Nearly a 1000 bytes less than the original now that is pretty impressive.    I will probably have it store the data as hexadecimal in Str2 for convience.  Any suggestions will be considered.
Logged
Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Today at 03:28:01
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5642


Total Post Ratings: +589

View Profile
« Reply #6 on: 31 October, 2011, 20:20:25 »
0

a,b, and c are two byte tokens on-calc. They aren't represented the same as normal ASCII.

Yes they are, because we are talking about character codes, not tokens.  The ASCII chart that the calc uses has 256 characters that are each 1 space long.  Each can be referenced by a single byte number, using the Axe command >Char. 
Logged

FinaleTI
Believe in the pony that believes in you!
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 16:35:01
Date Registered: 04 June, 2010, 00:34:27
Location: Alteria
Posts: 1818


Total Post Ratings: +118

View Profile WWW
« Reply #7 on: 31 October, 2011, 20:48:41 »
0

This sounds neat! I could possibly use this for Nostalgia, as I only use uppercase letters.
Logged





So, yeah, I have a blog now. Nothing special, just your average ghost town.

Spoiler for Projects:
Spoiler for Pokemon TI:
Map engine is going to be redone from scratch, since I was lacking in organization last time. With a project as big as Pokemon, planning and organization is key, so that will probably be the brunt of the work done on this project for the time being.

Spoiler for Nostalgia:
Being worked on. Nothing really new to put here, but it's being worked on.

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

Spoiler for Nostalgia Origins: Sky's Story:
Currently on hold. I am unsure of whether this will remain DCS7 Hybrid BASIC or if it will use Batlib, Grammer or perhaps Axe.
This may see more progress once a demo of Nostalgia is released.
C0deH4cker
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 19 December, 2012, 22:22:42
Date Registered: 18 October, 2011, 23:19:08
Location: $9D95
Posts: 258


Total Post Ratings: +10

View Profile WWW
« Reply #8 on: 31 October, 2011, 21:00:26 »
0

Looks interesting... I have a project that could benefit from this...
Logged

Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Yesterday at 09:26:23
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2043


Total Post Ratings: +254

View Profile
« Reply #9 on: 31 October, 2011, 21:38:19 »
0

That is about 33% compression with the strings.
shocked

Any suggestions will be considered.
Please, please, please add lowercase <insert begging smiley here>
In my game, I have more than 1900 bytes of text data. You compression would save a lot of space.
« Last Edit: 31 October, 2011, 21:38:31 by Hayleia » Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
parserp
Hero Extraordinaire
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 16 May, 2013, 23:40:53
Date Registered: 08 September, 2011, 02:01:43
Location: Here.
Posts: 1420


Total Post Ratings: +80

View Profile WWW
« Reply #10 on: 31 October, 2011, 22:47:47 »
0

This is way cool!!!
and yes please do include lowercase. <insert puppy dog eyes> Tongue
Logged

ticalc.org | Cemetech | TI-Freakware | casiocalc.org

My New Website!
Spoiler for The Rest:



A useful tool
Spoiler for bands:
Five Finger Death Punch
Disturbed
Slipknot
Linkin Park
Avenged Sevenfold
Breaking Benjamin
Skillet
30 Seconds to Mars
gtaforever00
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 25 November, 2011, 11:09:10
Date Registered: 26 October, 2011, 21:01:54
Posts: 10

Topic starter
Total Post Ratings: +4

View Profile
« Reply #11 on: 31 October, 2011, 23:25:08 »
0

Ok i'll see what I can do with the lowercase letters.  Another thing,  what about numbers?  With my current routine and plans on the lowercase,  I can only have about 64 characters.  I could take out some of the symbols if numbers was needed.
Logged
parserp
Hero Extraordinaire
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 16 May, 2013, 23:40:53
Date Registered: 08 September, 2011, 02:01:43
Location: Here.
Posts: 1420


Total Post Ratings: +80

View Profile WWW
« Reply #12 on: 31 October, 2011, 23:29:22 »
0

what do you mean by symbols?
Logged

ticalc.org | Cemetech | TI-Freakware | casiocalc.org

My New Website!
Spoiler for The Rest:



A useful tool
Spoiler for bands:
Five Finger Death Punch
Disturbed
Slipknot
Linkin Park
Avenged Sevenfold
Breaking Benjamin
Skillet
30 Seconds to Mars
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 00:55:01
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Total Post Ratings: +1019

View Profile
« Reply #13 on: 31 October, 2011, 23:52:54 »
0

Another idea, during decompression, you can automatically make the first letter of every sentence uppercase, and the rest lowercase. That way it still looks nice, but it takes up the same amount of space.  You can use other rules too to capitalize things in quotes.  Also, don't forget about characters '0' through '9', those are probably important too.
Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Yesterday at 09:26:23
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2043


Total Post Ratings: +254

View Profile
« Reply #14 on: 01 November, 2011, 09:31:07 »
0

Ok i'll see what I can do with the lowercase letters.  Another thing,  what about numbers?  With my current routine and plans on the lowercase,  I can only have about 64 characters.  I could take out some of the symbols if numbers was needed.
Personally, I use numbers 1,2,3,4 and symbols !?.,-':
I think that is all. But yeah, I am not alone in this planet, so do what you think is fair Tongue

Another idea, during decompression, you can automatically make the first letter of every sentence uppercase, and the rest lowercase. That way it still looks nice, but it takes up the same amount of space.  You can use other rules too to capitalize things in quotes.  Also, don't forget about characters '0' through '9', those are probably important too.
But if we want to display "Hi Ginny !", then Ginny will be with lowercase Big frown
But yeah, that would save space.
Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.284 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.