Luxoft coding exercise

Luxoft started some special compaign to find/hire more developers.
Here they put small exercise to catch attention of software developers.
The task is to decode ascii text provided as binary string.
There is my implementation by ruby and decoded text:

## If you are reading this message you definitely know what binary code is about.# Take a chance and win a certificate for free training-course at Luxoft Training to upgrade your skills in the IT subject you are interested in#bin_code = "010010010110011000100000011110010110111101110101001000000110000101110010011001010010000001110010011001010110000101100100011010010110111001100111001000000111010001101000011010010111001100100000011011010110010101110011011100110110000101100111011001010010000001111001011011110111010100100000011001000110010101100110011010010110111001101001011101000110010101101100011110010010000001101011011011100110111101110111001000000111011101101000011000010111010000100000011000100110100101101110011000010111001001111001001000000110001101101111011001000110010100100000011010010111001100100000011000010110001001101111011101010111010000101110000011010000101001010100011000010110101101100101001000000110000100100000011000110110100001100001011011100110001101100101001000000110000101101110011001000010000001110111011010010110111000100000011000010010000001100011011001010111001001110100011010010110011001101001011000110110000101110100011001010010000001100110011011110111001000100000011001100111001001100101011001010010000001110100011100100110000101101001011011100110100101101110011001110010110101100011011011110111010101110010011100110110010100100000011000010111010000100000010011000111010101111000011011110110011001110100001000000101010001110010011000010110100101101110011010010110111001100111001000000111010001101111001000000111010101110000011001110111001001100001011001000110010100100000011110010110111101110101011100100010000001110011011010110110100101101100011011000111001100100000011010010110111000100000011101000110100001100101001000000100100101010100001000000111001101110101011000100110101001100101011000110111010000100000011110010110111101110101001000000110000101110010011001010010000001101001011011100111010001100101011100100110010101110011011101000110010101100100001000000110100101101110"n = bin_code.length / 80.upto(n-1) { |i|    s = bin_code[i*8...(i+1)*8]    print s.to_i(2).chr}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: