Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Puzzle

by /dev/null (Chaplain)
on Sep 04, 2002 at 16:55 UTC ( [id://195130]=perlmeditation: print w/replies, xml ) Need Help??

Can anyone solve this puzzle? I found this binary snippet in a 2nd level Unix Administrators email signature. I was able to solve it in 20 minutes only after he mentioned that it could be solved with a perl one-liner.
100110101111011010101110000001001100011 010000110011101101110010000101110000001001100111011110110001101100110 111010100110000001001000011000000100000011100100111011110110010001100 011011010100110101101100000010010010110011101100000010000101110000101 101010011000000100110011101000011010110110101001100101000010110110100 101100111011000100110000001001110111000010110100101101100011000010110 000001001100011001001110101001101000011000101110101001100010011000000 100001011100001011010100110000001000000111001001110111101100100011000 110110101001101011011001110100010100001011010010000010001101100100011 010100110010011100010111000000100101000101001011001110110110011100010 111010100110100101100111011001010000

Replies are listed 'Best First'.
Re: Puzzle
by waswas-fng (Curate) on Sep 04, 2002 at 17:12 UTC
    You can't solve a problem in the same
    mind which created the problem.
    -Albert Einstein


    -Waswas Edited, they wana see the oneliner...
    perl -e '{ print pack "b*", "100110101111011010101110000001001100011 +010000110011101101110010000101110000001001100111011110110001101100110 +111010100110000001001000011000000100000011100100111011110110010001100 +011011010100110101101100000010010010110011101100000010000101110000101 +101010011000000100110011101000011010110110101001100101000010110110100 +101100111011000100110000001001110111000010110100101101100011000010110 +000001001100011001001110101001101000011000101110101001100010011000000 +100001011100001011010100110000001000000111001001110111101100100011000 +110110101001101011011001110100010100001011010010000010001101100100011 +010100110010011100010111000000100101000101001011001110110110011100010 +111010100110100101100111011001010000"; }'
Re: Puzzle
by charnos (Friar) on Sep 04, 2002 at 17:21 UTC
    I've never used pack() in any useful form (shame on me) before and i'm using win2k, so this must look hideous:

    H:\>perl -e "$bin='100110101111011010101110000001001100011010000110011 +101101110010000101110000001001100111011110110001101100110111010100110 +000001001000011000000100000011100100111011110110010001100011011010100 +110101101100000010010010110011101100000010000101110000101101010011000 +000100110011101000011010110110101001100101000010110110100101100111011 +000100110000001001110111000010110100101101100011000010110000001001100 +011001001110101001101000011000101110101001100010011000000100001011100 +001011010100110000001000000111001001110111101100100011000110110101001 +101011011001110100010100001011010010000010001101100100011010100110010 +011100010111000000100101000101001011001110110110011100010111010100110 +100101100111011001010000'; $l=length($bin);$a = pack \"b$l\", $s; pri +nt $a;"
    Output:
    You can't solve a problem in the same mind which created the problem. -Albert Einstein

    Edit:3 Seconds later...b*! i knew there had to be a way to stuff in all input bytes. i simultaneously saw waswas-fng's post, and spotted that line in perldoc -f pack. ah well.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://195130]
Approved by ignatz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 11:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found