5
0
Your task is to write a program, which takes a binary input and converts it to plain text. For Example:
01100001 01100010 01100011 = "abc"
Rules
- Input can come from STDIN, function arguments, command line argument, file, whatever suits you.
- The program can be a function, full program, whatever works, really, as long as no external uncounted code/arguments are needed to run it.
- You can assume that the input is valid.
- The length of the input is not limited
- You can assume that all blocks are seperated with whitespaces
Test Cases
01010100 01100101 01110011 01110100 = "Test"
01001000 01100101 01101100 01101100 01101111 = "Hello"
01010111 01101111 01110010 01101100 01100100 00001101 00001010 = "World"
01000101 01111000 01100001 01101101 01110000 01101100 01100101 00001101 00001010 = "Example"
01100010 01101001 01101110 00001101 00001010 = "bin"
This is code-golf, so the shortest solution wins.
2Do mean we can or we must assume that all blocks are separated with whitespaces? – Dada – 2017-03-29T09:26:43.817
@Dada you can – Tom291 – 2017-03-29T09:27:27.210
Why does this look related to the binary heart challenge? Most answer there is just a text to binary converter. – Matthew Roh – 2017-03-29T10:22:22.460
What input formats are allowed? For example, an 8-column matrix of zeros and ones? A 2D array of chars? – Luis Mendo – 2017-03-29T10:25:57.657
Can I take the binary blocks with no separator (no space)? – seshoumara – 2017-03-29T10:37:17.193
@seshoumara Yes, you can. – Tom291 – 2017-03-29T10:59:52.887
You should really wait a few days to weeks before picking an accepted answer. What if someone manages shorter than 4 bytes in a few hours or days? – devRicher – 2017-03-29T11:17:45.440
2Why is the dc answer accepted at all? The 05AB1E answer was first. – Okx – 2017-03-29T11:22:31.007