Questions tagged [encoding]
This challenge relates to data expressed under a different representation or language (including encoding, decoding, and processing such data). Some examples of an encoding includes ASCII and UTF-8.
51
questions
11
votes
23
answers
922
views
Construct a uInt from an array of bits
Task is simple!
Take an array of binary values (can be boolean, 0/1, etc.) and use those bits to construct an n-th bit long unsigned integer (return type does not need to be an unsigned integer, just ...
2
votes
0
answers
171
views
Golf a PSK31 modulator
Given a string of ASCII text as input, encode it in BPSK31 using Varicode. You may either output an audio file in any common format, or play the audio over the device speakers. You may output at any ...
10
votes
12
answers
2k
views
Encrypting Emojis
Problem
You are tasked with creating a program that performs emoji encryption on a given string of emojis. In this encryption scheme, each emoji is replaced by a unique character (from ...
10
votes
3
answers
332
views
Representing a number as an unordered list of smaller numbers
Suppose we want to encode a large integer \$x\$ as a list of words in such a way that the decoder can recover \$x\$ regardless of the order in which the words are received. Using lists of length \$k\$ ...
14
votes
7
answers
1k
views
Gödel encoding - Part II (decoding)
Part I
Previous part was considered encoding of non-empty nested lists with a positive integer.
Reminding the coding procedure \$G(x)\$:
If \$x\$ is a number, \$G(x) = 2^x\$
If \$x\$ is a list \$[n_0,...
31
votes
18
answers
3k
views
Gödel encoding - Part I
Related but different.
Part II
Taken from the book: Marvin Minsky 1967 – Computation:
Finite and Infinite Machines, chapter 14.
Background
As the Gödel proved, it is possible to encode with a unique ...
13
votes
25
answers
2k
views
Output the length of (the length plus a message) [duplicate]
The task is simple. You're given an arbitrary string message. Return that message prefixed with a number, such that the length of that number plus the message equals the number. In other words, the ...
6
votes
4
answers
346
views
Encoder/Decoder for efficient number storage!
Description
Inspired by this question, write a program/function to encode a number and a program (possibly the same as the first) to decode a bitstream in variable-length encoding as follows (taken ...
18
votes
9
answers
2k
views
ro1000an nu1000era50 en100o501ng
In the hovertext of this xkcd:
There's an "encoding" based on replacing runs of roman numerals with their sums. To do this:
Find all runs of at least 1 roman numeral (...
14
votes
12
answers
2k
views
Nega-Zeckendorf representation
Background
Zeckendorf representation is a numeral system where each digit has the value of Fibonacci numbers (1, 2, 3, 5, 8, 13, ...) and no two consecutive digits can be 1.
Nega-Zeckendorf ...
10
votes
8
answers
831
views
Encode a Lenguage
The Len(language,encoding) family of languages is a variety of Lenguage derivatives. To encode a program into a Len language, you replace every character with its representation in a certain encoding, ...
18
votes
14
answers
1k
views
Encode USB packets (part 2)
Inspired by this video by Ben Eater. This challenge forms a pair with Decode USB packets.
The USB 2.0 protocol uses, at a low level, a line code called non-return-to-zero encoding (specifically, a ...
32
votes
19
answers
3k
views
Decode USB packets
Inspired by this video by Ben Eater. This challenge forms a pair with Encode USB packets.
The USB 2.0 protocol uses, at a low level, a line code called non-return-to-zero encoding (specifically, a ...
6
votes
0
answers
257
views
Build a program that outputs itself encoded as a QR [closed]
The goal is simple. Write a program that outputs itself encoded as a QR code.
A QR code is a way to encode data in a black and white image, similar to a 2D image.
An example implementation can be ...
17
votes
14
answers
1k
views
Implement swap encoding
Swap encoding is an encoding method where you iterate through a string, reversing sections of it between pairs of identical characters.
The basic algorithm
For each character in the string:
Check: ...