Questions tagged [binary]

Binary is the base 2 number system. Use this tag for challenges involving base 2.

Filter by
Sorted by
Tagged with
26
votes
6answers
4k views

1+1 = 10, 1+2 = 3

Write a function or program than can do simple arithmetic (addition, subtraction, multiplication and division) in both base 10 and base 2. The function will take a mathematical expression as input, ...
3
votes
5answers
809 views

Binary Run-Length Encoding [duplicate]

Overview Run-length encoding — sequences in which the same data value occurs in many consecutive data elements are stored as a single data value and count When using run-length encoding: ...
19
votes
2answers
902 views

Koopa Shell Sequence

In various Super Mario games green and red Koopa Troopa shells can slide frictionlessly on flat surfaces and destroy brick blocks that are in their way. When a shell hits a brick block the block ...
8
votes
3answers
187 views

Counting cycles in a folding and squashing process

In chaos theory, the horseshoe map is an example of how chaos arises in a simple process of folding and squashing. It goes like this: take an imaginary piece of dough, fold it, and finally squash it ...
39
votes
13answers
2k views

Generate the Temple Skyline Sequence

Consider the following process: Take some non-negative integer N. e.g. N = 571 Express it in binary with no leading zeroes. (Zero itself is the only exception, ...
0
votes
2answers
160 views

Generate ordered binary combinations without repetitions [closed]

Challenge Write the shortest program that receives two signed integers n and i and for each ...
17
votes
3answers
431 views

Toggle, Print, Repeat

This challenge is loosely inspired by the unimplemented esolang Pada. Consider an array of 8 bits, all initialised to zero. We'll introduce a very minimalistic instruction set to print arbitrary ...
18
votes
7answers
1k views

Binary Images of Triangle Counts

My challenges tend to be a little bit hard and unattractive. So here something easy and fun. Alcuin's sequence Alcuin's sequence A(n) is defined by counting ...
6
votes
7answers
855 views

Find the simplest value between two values

Goal Your goal is to find the simplest value in an open interval. In other words, given two values a,b with a<b, output the ...
7
votes
3answers
388 views

Nameless to Brainf**k converter

This is inspired by the Brainf*** to tinyBF converter challenge. Brainf**k (which will be henceforth referred to as BF) is a well-known estoric programming language, so I won't go over it too much ...
11
votes
11answers
861 views

Binary encryption

This is based on xkcd #153. Make a program or named function which takes 2 parameters, each of which is a string or a list or array of bytes or characters. The second parameter will only contain ...
6
votes
1answer
2k views

Nokia mystery puzzle [closed]

A friend sent me this puzzle. I'm pretty sure solving it will require some programming. Can anyone crack it? The original is here in case of encoding issues in the past below. ...
7
votes
4answers
763 views

Convert from binary to unary in 7x7 Manufactoria

In the game manufactoria, take in a binary number and output that number of red pieces. The catch? The board-size is only 7x7: Here's the manufactoria code for the problem: http://pleasingfungus.com/...
0
votes
2answers
6k views

Make a regex that matches certain binary numbers [closed]

Your task is to create a regular expression that matches most binary numbers with an even number of 0s and an odd number of 1s (...
13
votes
3answers
3k views

Bitwise Operators in Brainfuck

Your task is to create one brainfuck program for each of the following binary operators. Each program should take one or two 8-bit numbers (A and B) from input and calculate the specified operation: <...
7
votes
2answers
766 views

math with bitwise operators

objective write a program that can perform addition, subtraction, multiplication, and division, using only bit-wise operators, by bit-wise operators i mean the equivalent of JavaScript ...
-1
votes
5answers
710 views

change two bits by using only bitwise operations [closed]

try to write shortest possible variant of logic which converts binary input by this table: 00 -> 00 01 -> 10 10 -> 01 11 -> 11 You can use only ...

1 2 3
4