Questions tagged [binary]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
148 views

Generate ordered binary combinations without repetitions [closed]

Challenge Write the shortest program that receives two signed integers n and i and for each ...
-1
votes
13answers
510 views

Find how “smooth” a number is based on binary

I haven't been on PP&CG for a while, so I thought I would post something! Your task is to find how "smooth" a natural number is. Your method is to: 1: Convert the number to binary 2: Find the ...
-1
votes
5answers
698 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 ...
-2
votes
6answers
191 views

Add 2 positive integers by playing with bits [closed]

Given 2 positive integers in any format you'd like, return their sum using only logic gates and bit shifts (see example below). Don't worry about overflow. EDIT: Using pre-written addition is ...
-2
votes
2answers
122 views

Generating all Character possibilities with two characters [duplicate]

Introduction So the Challenge is to give out all combinations with two Inputs. The length of the string is also optional and you should be able to edit this. I've selected this channel because I ...
-5
votes
4answers
223 views

Binary Magic Cards [closed]

There's a cool magic trick that works using the power of binary. The effect of the trick is as follows: An audience member chooses some natural number in the range of ...