I'm trying to create books in TI-BASIC, but they would be incredibly large. Does anyone know of a compression program I can use to reduce the size?
Books are very big and probably won't fit in the calculator's memory. You can't compress bytes without making more bytes. So probably not. Sorry :(
But instead of books, you can do your favorite chapters from your books.
…keep in mind that big books can take a massive amount of memory, in which the CE can only hold about 4MB of ROM (4,000,000 bytes) and ~148kB of RAM (148,000 bytes). Books can have millions of letters and the calculator won't be able to hold it all.
EDIT: There IS a text compression tool, but it's only for Monochrome calcs. https://www.ticalc.org/archives/files/fileinfo/445/44523.html
Hewwo, my name is Achak Claw. I was formerly BioHazard.
If your text is stored in Str1, just do this:
Str1+".zip"->Str1
Why use something so long?
.gz is shorter than .zip
Haha true! I’m just more used to .zip. But hey, it’s just the file extension so it shouldn’t really matter much :P
How would adding ".zip" compress it? Does it work on the TI-84 Plus CE and CSE?
I just did what Trenly and
Michael2_3B provided, and it does not seem to work. The Str1.8xs is still recognized as a string, and not a zip/tar.gz
Hewwo, my name is Achak Claw. I was formerly BioHazard.
Indeed. My apologies.
I actually do have a string "compression" algorithm I made in the sense that in can store 4 characters per list element. This is done by storing character indices from a reference string into the integer and fractional part of both a real and imaginary number in the same element (resulting in something like 1.002+3.004i for "ABCD")
However, the resulting list ends up taking up much more space than the original string.
Anyways, you might be able to store a bit of a chapter into a string like BioHazard suggested, you can also archive it to avoid it being overwritten.
In TI-BASIC you'll have a difficult time, but with some help with assembly and a computer to do the actual compressing, you could probably manage it :)
In this program, I included a python utility that compresses files and then you use an on-calc program to decompress.
In that program, the decompression is only intended for pic vars, but that is easy-ish to fix. The compression program takes any kind of data, though, so for example, I copied this thread's text and it compressed it to 65% of the original size.
EDIT: Erp, accidentally submitted.
Anyways, there are compression routines specifically targeted toward text compression, and you could probably see much better results. For example, some routines can average better than 85% as the size tends to inifinity. That's pretty wild.
To sum up: With a computer and an on-calc assembly program, you could possibly achieve this for relatively small books :)
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Also, .zip files won't be read as zips on the calculator. It will still be read as a STRNG.
Hewwo, my name is Achak Claw. I was formerly BioHazard.