Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

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]

Filter by
Sorted by
Tagged with
19 votes
21 answers
2k views

Implement the RegPack decompressor

The JavaScript compressor RegPack uses a very simple string compression algorithm. Given a piece of code, it will make a list of characters that aren't used in that code and use them to delimit ...
17 votes
14 answers
3k views

I want 8 bits for every character!

This is the reverse of this challenge. Given an encoded list of codepoints and the characters used to encode it, you need to decompress it to its original string. For example, given the encoded list <...
10 votes
7 answers
535 views

Random Pixels Image Compression

Challenge: Given an integer \$n\,ドル guaranteed to be \$\geq2\$ and a power of 2, we are going to draw multiply boards either side-by-side or below one another, where the first has dimensions of \$n\$ ...
24 votes
17 answers
4k views

Who needs 8 bits for one character?

Given a string and the characters used to encode it, you need to compress the string by only using as many bits as each character needs. You will return the character codes for each character needed ...
-4 votes
1 answer
308 views

Program compressor

Choose a language and write a program in the language that: Take a valid program of the language as input, Output a string(bytearray, etc.). It needn't be a valid program. Only finite valid inputs ...
14 votes
8 answers
834 views

Compress and decompress

Your task is to make a bidirectional compressor. It takes a list of bytes as input and returns a list of bytes as output. It has the property than whenever it is iterated twice it returns the original ...
11 votes
2 answers
820 views

Smallest possible Scratch 3.0 project file (SB3)

The objective is to make the smallest SB3 file that can simply be imported into Scratch 3.0 without a "The project file that was selected failed to load" error. Any means can be used, like ...
12 votes
3 answers
944 views

Jelly compression quine

The golfing language Jelly has a very complex and clever string compression system which I'm not going to go into depth about here. You can find a very good explanation here. Basically, Jelly's string ...
14 votes
2 answers
559 views

What's my TIO uniqueness?

Try it online! currently has 680 listed languages, all of which are searchable. For most of those languages, when searching for it, you don't have to enter the entire string. For example, entering <...
50 votes
7 answers
7k views

Reverse Zip Bomb

A zip bomb is a compressed file, designed so that unpacking it yields the biggest file possible. These are fairly well known, and there are examples of 42 KB files which expand into multiple petabytes ...
rydwolf's user avatar
rydwolf
  • 19.3k
21 votes
3 answers
682 views

Decompress an integer, Jelly style

Jelly has compressed string literals, using the "...» delimiters. The way these work is by interpreting the ... as a base-250 ...
12 votes
9 answers
2k views

Naïve compression

using Prefixed Length Code We are going to implement a compression of text (string, array/list of characters/bytes) by simple substitution of each character by a binary code, based on the frequency of ...
10 votes
5 answers
1k views

Breaking Bad - ize any string (compression) [duplicate]

The TV series "Breaking Bad" replaced the letters Br and Ba with a periodic-table like representation, printing [Br35]eaking [Ba56]d. Create a program ...
32 votes
20 answers
3k views

Golf a golf chart

Given a distance in meters as an integer \60ドル\le d \le 260\,ドル return the number of clubs that may be used according to the following arbitrary chart, where both \$min\$ and \$max\$ are inclusive: <...
Arnauld's user avatar
  • 206k
25 votes
14 answers
2k views

Print a Ternary Value

Put simply, you are to print out the following number: ...

15 30 50 per page
1
2 3 4 5
...
7

AltStyle によって変換されたページ (->オリジナル) /