I made these simple utilities for a Zelda clone/fan game I'm working on, and I thought they might be useful in other BASIC programs. Be aware that it overwrites the following variables: L1, L2, A, B, C
They are designed to compress (RLECMP) and extract (RLEEXT) lists using a simple Run-Length Encoding algorithm.
NOTE: Due to a minor bug I haven't been able to track (it doesn't appear to be off-by-one incrementing, as the associated fix causes a dimension error), the compression routine skips the last element of the list it's compressing. Extraction faces no such issues. My current workaround is to repeat the last element before compressing, but a true fix would be greatly appreciated.
SYNTAX: Both utilities accept their input list in ANS (so I can call them with "L1:prgmRLECMP" and "L1:prgmRLEEXT"). The result is stored to ANS after compression. "999" is added to the beginning of the compressed list so programs can easily detect whether it is actually compressed.
https://drive.google.com/open?id=1sW2v05BPCMSNTguKnbD2Bho1ygAVNlwD
They are designed to compress (RLECMP) and extract (RLEEXT) lists using a simple Run-Length Encoding algorithm.
NOTE: Due to a minor bug I haven't been able to track (it doesn't appear to be off-by-one incrementing, as the associated fix causes a dimension error), the compression routine skips the last element of the list it's compressing. Extraction faces no such issues. My current workaround is to repeat the last element before compressing, but a true fix would be greatly appreciated.
SYNTAX: Both utilities accept their input list in ANS (so I can call them with "L1:prgmRLECMP" and "L1:prgmRLEEXT"). The result is stored to ANS after compression. "999" is added to the beginning of the compressed list so programs can easily detect whether it is actually compressed.
https://drive.google.com/open?id=1sW2v05BPCMSNTguKnbD2Bho1ygAVNlwD