Related to compressing or decompressing arbitrary data. Challenges which relate to compressing a single specific input should instead be tagged [kolmogorov-complexity]
25
votes
2answers
649 views
Compress an image to a 4 KiB preview
In this challenge you will be creating an image preview compression algorithm. It's goal is to
reduce an arbitrary image file to a 4 KiB preview image, that can be used to quickly identify images
with ...
12
votes
4answers
351 views
Strategies for representing a given large integer using arithmetic expression
I have a specific number in mind, but it's part of a challenge I'm doing, and I don't want people to do (all) the work for me.
Here is a number which has the same digits, but shuffled:
...
176
votes
32answers
25k views
Paint Starry Night, objectively, in 1kB of code
Below is a 386x320 png representation of van Gogh's Starry Night.
Your goal is to reproduce this image as closely as possible, in no more than 1024 bytes of code. For the purposes of this ...
12
votes
5answers
435 views
Implement a URL shortener
URLs are getting too long. So, you must implement an algorithm to shorten a URL.
i. The Structure of a URL
A URL has 2 main parts: a domain and a path. A domain is the part of the URL before the ...
8
votes
4answers
455 views
Write two programs that compresses and decompresses data
Challenge:
Create a program that compresses a semi-random string, and another program that decompresses it. The question is indeed quite similar to this one from 2012, but the answers will most ...
16
votes
4answers
2k views
Big big numbers
Whilst trying to golf several of my answers, I've needed to write large integers in as few characters as possible.
Now I know the best way to do that: I'll be getting you to be writing this program.
...
11
votes
1answer
527 views
Lossless English language text compression challenge [closed]
Challenge:
Your challenge (should you choose to accept it) is to compress and decompress the 5MB "Complete Works of William Shakespeare" as found here:
...
0
votes
1answer
246 views
ASCII art compression
The following challenge is basically a simpler version of the one proposed by Dennis (Lossy ASCII art compression). I found the idea super interesting but a bit too convulted, and seeing as it didn't ...
12
votes
0answers
567 views
Lossy ASCII art compression
Background
PICASCII is a neat tool that converts images into ASCII art.
It achieves different degrees of brightness by using the following ten ASCII characters:
@#+';:,.`
We'll say that these ...
13
votes
4answers
323 views
Implement bzip2's run-length encoding
Background
After applying the BWT (as seen in Burrows, Wheeler and Back) and the MTF (as seen in Move to the printable ASCII front), the bzip2 compressor applies a rather unique form of run-length ...
18
votes
7answers
641 views
Move to the printable ASCII front
Background
The move-to-front transform (MTF) is a data encoding algorithm designed to improve the performance of entropy encoding techniques.
In the bzip2 compression algorithm, it is applied after ...
13
votes
3answers
481 views
Burrows, Wheeler and Back
Background
The Burrows–Wheeler transform (BWT) is a reversible permutation of the characters of a string that results in large runs of similar characters for certain types of strings such as plain ...
16
votes
5answers
685 views
Boggle Board Compression
When working on Non-Palindromic Polyglot Boggle, I found it quite tedious to pack the codes as efficiently as possible onto the Boggle board, even with only two strings. But we're programmers, right? ...
7
votes
4answers
674 views
Write an URL compressor
Today your goal is to invent URL compression. You must write two programs: a compressor and a decompressor.
The compressor will be called with one URL on stdin and its output will be read on stdout.
...
8
votes
2answers
736 views
Write a GIF encoder
Yes, the good old GIF. Loved for its versatility, hated for its patents and partly obsoleted due to its limitations (and patents), GIF consists, at the core, of a color palette and a palette-indexed ...
7
votes
7answers
778 views
Writing code for three tasks
When you run your program first, it should print an integer sequence. The
second run should print the 'Mary had a little lamb' song. The third run should
produce an ASCII image file.
Scoring
Your ...
0
votes
1answer
653 views
CSS attribute selector efficient “greater than selector” code [closed]
The goal is to find a way better than the current best known way of encoding the index of a child HTML element, so that encoded indices have the following property.
if (index_i >= index_p) {
...
29
votes
14answers
4k views
Sudoku Compression
Your job is to write a program (or two separate programs) in any language that:
Can take a completed Sudoku board as input (in any logical format) and compress it into a string of characters
Can ...
6
votes
1answer
417 views
Invent your own Unicode 7.0.0 encoding (as efficient as possible)
As you may know, the Unicode standard has room for 1,114,111 code points, and each assigned code point represents a glyph (character, emoji, etc.).
Most code points are not yet assigned.
Current ...
8
votes
2answers
470 views
Rosetta Stone Challenge: Run-Length Encoding v2.0
The goal of a Rosetta Stone Challenge is to write solutions in as many languages as possible. Show off your programming multilingualism!
The Challenge
We've done run-length encoding before but only ...
4
votes
1answer
244 views
Recover a bzip2 file
The popular .bz2 compression format is used to store all sorts of things. One of the more interesting features is that it consists of several independently decompressible blocks, allowing recovery of ...
11
votes
6answers
658 views
Thwart LZMA2 compression
Goal
Create a program or pair of programs that collectively disrupt and fix files with the intent of preventing LZMA2 from working effectively. The disrupt and fix routines must be reciprocal, so ...
15
votes
2answers
909 views
Monopoly Compression
Given a string representing the current state of a game of Monopoly at the beginning of a player's turn, compress all the necessary data into the smallest output. Answers will be judged by output size ...
33
votes
2answers
1k views
Musical Tweet Challenge
This is the audio version of the Twitter image encoding challenge.
Design an audio compression format that can represent at least one minute of music in 140 bytes or less of printable UTF-8-encoded ...
5
votes
2answers
524 views
Analysing the most common words in a text, and replacing them with a single byte
This is a very crude text encoding algorithm I came up with the other day. It won't work if the text has more than 256 different characters in it – but it does support Unicode, at least in my Python ...
4
votes
10answers
577 views
Golf an LZW encoder
Given an alphabet and a string, your job is to create the
Lempel–Ziv–Welch compression of the string. Your implementation can either be a function with
two parameters and a return value, or a full ...
26
votes
14answers
3k views
Smallest chess board compression
Write an algorithm or program that can encode and decode a chess board. The goal is to make the smallest representation of a chessboard that could be used (once decoded) to determine all movement ...
8
votes
2answers
594 views
Create self-extractor script (relaxed rules)
This is the target language-relaxed version of Generate a self-extractor application
Create a program in any language, that takes an arbitrary binary input, and generates a valid program (also in any ...
5
votes
2answers
461 views
Generate a self-extractor application
Create a program in any language, that takes an arbitrary binary input, and generates a valid C++11 program, which when compiled and run will print this binary input.
So you could do this (on linux ...
1
vote
1answer
608 views
Compressing a DNA-like string [closed]
my app is multiple choice test, where for each question the response results in a 4 letter string "eg" GTAC or ATGC or CATG, etc. There are always just 24 questions. so the final result is something ...
6
votes
12answers
662 views
Output code-sized text
Output the same length of Lorem ipsum your code is!
Rules:
length is bits/8
length has to be positive
code can't be identical to output
no compression library
shortest or super creative program in ...
7
votes
2answers
602 views
Compress data with context free grammars
It is possible to compress some kinds of data, such as human text or source code, with straight-line grammars. You basically create a grammar whose language has exactly one word – the uncompressed ...
0
votes
2answers
296 views
Storing a DNS name as compactly as possible in memory (preferably in C#) [closed]
What is the most compact way to encode/save DNS names in memory?
For example, storing "www.google.com" as a string in .NET will result in the object being encoded as UTF-16, and it will consume twice ...
29
votes
9answers
3k views
Text compression and decompression — “Nevermore.”
With the recent discussion about the use of compression tools in code golf, I thought it would be a nice challenge to write your own text compressor and decompressor.
Challenge:
Write two programs: ...
8
votes
3answers
1k views
Lossy Text Compression
Background
Of the 256 possible characters that a byte can represent, only a few of these are used under most circumstances. Couldn't we somehow take advantage of this, and make our text files smaller ...
14
votes
16answers
1k views
Run-Length Encoding
Write a program uses run-length encoding to shorten a list of non-negative integers it has to read in.
You can assume the non-negative integers can fit in 32bit signed integers.
Input Format
The ...
6
votes
3answers
318 views
Compress programs
Write a program/script that decompresses and passes any compressed data appended at the end of the binary/file as standard input to a program specified as arguments.
$ gzip --to-stdout input >> ...
10
votes
1answer
538 views
Write a compressing util for gzip files
The task of this challenge is as following:
Write a program that reads a file of reasonable size (let's say <16 MB) from stdin or anywhere else (however you like, but must not be hardcoded), and ...