This project demonstrates a simple Run-Length Encoding (RLE) compression algorithm implemented in Zig. The goal of this project is to learn the Zig programming language and explore the RLE compression concept.
Run-Length Encoding (RLE) is a basic form of data compression where sequences of the same data value are stored as a single data value and count. For example, the string "AAAA" would be compressed to "A4". This project helped in learning Zig and understanding how to implement a simple compression algorithm.
-
Install Zig: Follow the instructions on the Zig website to install Zig.
-
Clone the repository:
git clone https://github.com/yourusername/basic-rle-in-zig.git cd basic-rle-in-zig -
Build the project:
zig build-exe src/main.zig
-
Run the executable:
./main <your-string>
Running the program with the input SSaaahilistheGOOat:
./main SSaaahilistheGOOatOutput:
Character '83': 2
Character '97': 3
Character '104': 1
Character '105': 1
Character '108': 1
Character '115': 1
Character '116': 1
Character '71': 1
Character '79': 2
Updated string: S2a3hilistheGO2at
This project is licensed under the MIT License. See the LICENSE file for details.
Now You can input via userInput
