Problem of the Day
A new programming or logic puzzle every Mon-Fri

Beep Boop

Hope everyone had a great weekend. Let's get this show on the road!

1010011010010000100010101101111110001100100100001001001110001001100110101001101111011111100101101000101111011110

Permalink: http://problemotd.com/problem/beep-boop/

Comments:

  • Sejsel - 10 years, 9 months ago

    It is a simple Binary to ASCII conversion. You have to change ones to zeroes and vice versa.

    I will not spoil what it says, though :)

    reply permalink

  • Max Burstein - 10 years, 9 months ago

    It is not that simple :)

    reply permalink

  • Mre - 10 years, 9 months ago

    /* Mre64 7/7/14

    "The internet is a great way to get on the net."
        - Bob Dole
    

    */

    import java.util.ArrayList;

    public class BTADecrypt { private static ArrayList<String> al = new ArrayList<String>(); private static String key = "0101100101101111011101010010000001110011011011110110110001110110011001010110010000100000011010010111010000100001"; private static String newMessage = "";

    public static void main(String[] args) {
    
        decrypt();
    
    }
    
    public static void decrypt() {
        splitKey();
    
        for (int i = 0; i < 10; i++) {
            // find the corresponding ASCII value and print its letter
            switch (al.get(i)) {
            case "01100001":
                System.out.print("a");
                break;
            case "01100010":
                System.out.print("b");
                break;
            case "01100011":
                System.out.print("c");
                break;
            case "01100100":
                System.out.print("d");
                break;
            case "01100101":
                System.out.print("e");
                break;
            case "01100110":
                System.out.print("f");
                break;
            case "01100111":
                System.out.print("g");
                break;
            case "01101000":
                System.out.print("h");
                break;
            case "01101001":
                System.out.print("i");
                break;
            case "01101010":
                System.out.print("j");
                break;
            case "01101011":
                System.out.print("k");
                break;
            case "01101100":
                System.out.print("l");
                break;
            case "01101101":
                System.out.print("m");
                break;
            case "01101110":
                System.out.print("n");
                break;
            case "01101111":
                System.out.print("o");
                break;
            case "01110000":
                System.out.print("p");
                break;
            case "01110001":
                System.out.print("q");
                break;
            case "01110010":
                System.out.print("r");
                break;
            case "01110011":
                System.out.print("s");
                break;
            case "01110100":
                System.out.print("t");
                break;
            case "01110101":
                System.out.print("u");
                break;
            case "01110110":
                System.out.print("v");
                break;
            case "01110111":
                System.out.print("w");
                break;
            case "01111000":
                System.out.print("x");
                break;
            case "01011001":
                System.out.print("y");
                break;
            case "01111010":
                System.out.print("z");
            }
        }
    }
    
    public static void invertMessage() {
        char[] charArray = key.toCharArray();
    
        for (int i = 0; i < key.length(); i++) {
            // swap the 1 and 0 through the entire array.
            if (charArray[i] == '0') {
                newMessage += '0';
            } else {
                newMessage += "1";
            }
        }
    }
    // split the key message into bit 8 pieces
    public static void splitKey() {
        invertMessage();
        int index = 0;
        while (index < newMessage.length()) {
            al.add(newMessage.substring(index,
                    Math.min(index + 8, newMessage.length())));
            index += 8;
        }
    }
    

    }

    reply permalink

  • Anonymous - 10 years, 9 months ago

    "1010011010010000100010101101111110001100100100001001001110001001100110101001101111011111100101101000101111011110".scan(/.{8}/).collect{|s| (256 + ~s.to_i(2)).chr}.join

    reply permalink

Content curated by @MaxBurstein