Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [compression]

Related to compressing or decompressing arbitrary data. Challenges which relate to compressing a single specific input should instead be tagged [kolmogorov-complexity]

9
votes
2answers
428 views

ASCII Maze Compression

Challenge Design a compression algorithm specialized for compressing ASCII mazes. You will need to create both a compression algorithm and a decompression algorithm. Your score will be based on the ...
2
votes
7answers
335 views

Countries by Area

Challenge Given two non negative integers a < b, output all countries, from the below Top 100 Countries, where area is between ...
5
votes
3answers
195 views

Generate Matlab plot markers

Matlab has a useful command for visualizing data: plot. It draws data points using "markers" in 2-D space, connecting them with lines; however, for this challenge, ...
0
votes
4answers
396 views

Send the pairs in smallest output

Write two programs A and B. Program A (the encoder) takes 1024 pairs of integers \$(k,v)\$, where \$0≤k<2^{32}\$ and \$0≤v<1024\$, and all \$k\$ will be different. It will output a single ...
9
votes
33answers
1k views

Output some reserved words

For a computer language, a reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label. For other computer languages, keywords can be considered as ...
8
votes
3answers
378 views

Compress to Impress

Inspired by both the challenge "Unique is Cheap" by @Laikoni, where the score is based on the challenge itself, as well as the JavaScript (ES6) answer of @ETHproductions for the "Palindrome ...
22
votes
10answers
1k views

Compressing the Atomic Ionization Energies

This is a different type of compression challenge. In a normal kolmogorov-complexity challenge, you are required to recreate a list exactly. Here, you are allowed to round the values in any way you ...
36
votes
19answers
3k views

Bracket Expansion!

Your challenge is to expand some brackets in a program's input as shown: Find a string s between two matching brackets [ and ], ...
15
votes
4answers
676 views

Palindrome Compression

Challenge Write a program that compresses and decompresses ASCII text losslessly. It should be specialized to work well with palindromes, including case-insensitive and punctuation-insensitive ...
292
votes
22answers
36k views

Write Moby Dick, approximately

Here is a 1.2Mb ASCII text file containing the text of Herman Melville's Moby-Dick; or, The Whale. Your task is to write a program or function (or class, etc. -- see below) which will be given this ...
26
votes
8answers
2k views

Somewhere On The Tube …But On Which Lines?

The London Underground A.K.A. The Tube is the oldest underground railway in the world, it currently consists of eleven lines* servicing 267 named stations (strictly 269** stations since "Edgware Road" ...
10
votes
12answers
1k views

Simple State Sales Tax Calculator

Sales taxes in the United States are complicated, to say the least. Generally, there's a state sales tax (there are a handful of states that do not collect a state sales tax), but there could also be ...
17
votes
12answers
4k views

All your base 97 are belong to us

Many programming languages are written using solely printable ASCII, tabs and newlines. These 97 characters are then stored in 8-bit bytes (which are actually capable of holding 256 different ...
8
votes
2answers
882 views

Smallest chess game compression

Inspiration: Heavily inspired by Smallest chess board compression I decided to make a similar but distinctly different competition. tl;dr Take the file Chess_Games.txt and compress it as much as ...
10
votes
4answers
510 views

Compressing RLE data to draw ASCII art

This question is based on what I came up with to answer another question. Sometimes the questions here ask to draw some ASCII art. One simple way to store the data for the art is RLE (run-length ...
-6
votes
2answers
235 views

Output the Wikipedia article for Kolmogorov Complexity

Your job is to output the html of the current version (at the time of this writing) of the Wikipedia page for Kolmogorov complexity: https://en.wikipedia.org/w/index.php?title=Kolmogorov_complexity&...
29
votes
11answers
2k views

Which wire to cut

This task is about compressing and processing a sequence of conditionals. In the game Keep Talking and Nobody Explodes, a bomb defuser must disarm a bomb with the help of instructions relayed by ...
11
votes
13answers
1k views

The weird and wild bean game

Maybe some of you already know this game: you have a collection of jelly beans of different colors. For every color, the bean can have different tastes, some are good and some are bad, and you cannot ...
19
votes
0answers
453 views

Maximal discrepancy-2 sequence with minimal entropy

Background As noted in the PPCG challenge Compress a maximal discrepancy-2 sequence – which inspired this challenge – the authors of the paper Computer-Aided Proof of Erdős Discrepancy Properties ...
25
votes
21answers
3k views

Converting “0xUsernames”

0xUsernames There's so many people using a messaging service that they're running out of space to store all the usernames! To fix this, they are going to start storing usernames as hexadecimal, where ...
34
votes
9answers
2k views

Help me recognise my monster

Background The computer game NetHack dates from 1987, before the use of graphics in computer games was widely established. There are lots of monsters in the game, and potentially a lot need to fit on ...
10
votes
1answer
661 views

The Most Durable Pokemon Types

Background This question is similar to this one. I have provided all of the information needed below. If you are familiar with the other challenge then note that we are ranking all defenses instead ...
1
vote
0answers
159 views

Self compressing/decompressing program [closed]

Challenge: Write a lossless encoder/decoder that is able to compress its own source code. Usage: progname encode Encodes ...
7
votes
10answers
1k views

DNA Encode a String

Challenge You must write an encoder (and a separate decoder) which takes a string as input and outputs the string encoded in the style of a strand of DNA. DNA DNA is made up of four types of ...
2
votes
0answers
390 views

100KB image compression [closed]

Your task is to, given an image, compress it to 100000 bytes or less, while following all of the below rules: No cheating/loopholes. Your code must not be optimized to work best only on the test set ...
20
votes
1answer
437 views

Diff compression [closed]

For this challenge, you need to compress a diff. A diff is some data that represents the difference between two strings. For this challenge, you need to provide one or more programs that can: Input ...
17
votes
2answers
688 views

Thwart Lepton compression

Dropbox recently released Lepton (GitHub), a method that losslessly compresses JPEG images round-trip, saving an average of 22%. Because of the pigeonhole principle, any general compression algorithm ...
30
votes
8answers
2k views

Latin square compression

A Latin square is a square that has no repeated symbols in the rows or columns:. 13420 21304 32041 04213 40132 And as many Sudoku players know, you don't need ...
16
votes
7answers
783 views

Send a cosmic call

The cosmic call is a message sent into space in 1999 and 2003. It's made of 23 127*127px monochrome bitmap images, as detailed here. Your mission is to write a program that displays the entire 127*...
33
votes
29answers
2k views

Is it a prefix code?

In information theory, a "prefix code" is a dictionary where none of the keys are a prefix of another. In other words, this means that none of the strings starts with any of the other. For example, <...
30
votes
2answers
2k 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 ...
13
votes
4answers
550 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: ...
238
votes
36answers
41k views

Paint Starry Night, objectively, in 1kB of code

Note: Anders Kaseorg has been awarded the accept for now, to draw attention to his great answer, but the challenge is by no means over! There is still a 400 point bounty in the offering for anyone who ...
12
votes
5answers
570 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 ...
22
votes
2answers
696 views

Golfing Strings

I have always failed to give an answer for kolmogorov-complexity challenges which require string compression, the main reason being that I don't know to use string compression tools as effectively as ...
8
votes
4answers
731 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 ...
25
votes
6answers
3k 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. ...
12
votes
1answer
691 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: http://www.gutenberg.org/cache/epub/100/pg100....
0
votes
1answer
444 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 ...
21
votes
2answers
2k 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: ...
14
votes
4answers
513 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 ...
19
votes
7answers
740 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 ...
14
votes
3answers
605 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 ...
18
votes
5answers
791 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
820 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. ...
9
votes
2answers
1k 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 ...
8
votes
7answers
886 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
2k 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. ...
34
votes
14answers
5k 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 take ...
6
votes
1answer
573 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 ...