Re: Golf challenge: decode CETI message

2002-01-12 Thread Ilmari Karonen


On Fri, 11 Jan 2002, Philip Newton wrote:
 On Wed, 9 Jan 2002 20:34:30 -0500, [EMAIL PROTECTED] (Keith C. Ivey)
 wrote:
 
  But s'\x0\xff' @' to make it shorter and more visible on my system.
 
 y(s))y) ?

qBut y'\x0\xff' @' to make it yhorter and more viyible on my yyytem. ?

Besides, aren't single quotes special for s/// and y/// anyway?  I think
what Keith _really_ meant was tr[\0\xff][ @] or equivalent.

BTW, I'd like to congratulate you for producing worst-case backtracking
behavior in my mental parser with your, um, creative use of parentheses.

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Disconnected; connection lost (The connection has been lost.).
   -- F-Secure SSH client error message




Re: Golf challenge: decode CETI message

2002-01-12 Thread Ronald J Kimball

On Sun, Jan 13, 2002 at 03:41:40AM +0200, Ilmari Karonen wrote:
 
 On Fri, 11 Jan 2002, Philip Newton wrote:
  On Wed, 9 Jan 2002 20:34:30 -0500, [EMAIL PROTECTED] (Keith C. Ivey)
  wrote:
  
   But s'\x0\xff' @' to make it shorter and more visible on my system.
  
  y(s))y) ?
 
 qBut y'\x0\xff' @' to make it yhorter and more viyible on my yyytem. ?
 
 Besides, aren't single quotes special for s/// and y/// anyway?  I think
 what Keith _really_ meant was tr[\0\xff][ @] or equivalent.

I think what Keith *really* meant was not, use s'\x0\xff' @' in the code,
but rather, run s'\x0\xff' @' *on* the code, i.e. change the 7 character
sequence to the two character sequence.  The use of single quotes is
deliberate.

He's looking at the output of the code in ASCII, rather than converting the
output to an actual image.

Ronald



Re: Golf challenge: decode CETI message

2002-01-12 Thread Keith C. Ivey

Ilmari Karonen [EMAIL PROTECTED] wrote:

 Besides, aren't single quotes special for s/// and y/// anyway? 
 I think what Keith _really_ meant was tr[\0\xff][ @] or
 equivalent.

No, I was intending for the operation to be performed on the 
program Patrick had suggested (or my revision), not on the 
input file (which doesn't contain any \x00 or \xff).  So 
unless I'm missing something q(s'\x0\xff' @') was indeed what I 
meant, special meaning of single quotes and all.  That is, I 
wanted to change the part of the program that said 
q(tr,01\n,\x0\xff,d;) to q(tr,01\n, @,d;).

I have no explanation for my not changing 'tr' to 'y' (or for 
that matter not removing the 'x' in '\x0').  I hang my head in 
shame.

-- 
Keith C. Ivey [EMAIL PROTECTED]
Washington, DC



Re: Golf challenge: decode CETI message

2002-01-11 Thread Philip Newton

On Wed, 9 Jan 2002 20:34:30 -0500, [EMAIL PROTECTED] (Keith C. Ivey)
wrote:

 But s'\x0\xff' @' to make it shorter and more visible on my system.

y(s))y) ?

Cheers,
Philip



Re: Golf challenge: decode CETI message

2002-01-10 Thread Casey West

On Wed, Jan 09, 2002 at 02:22:57PM -0500, Patrick Gaskill wrote:
:
:There's an article about CETI's next message into space
:
:  http://slashdot.org/article.pl?sid=02/01/08/231247mode=nested
[ snip ]
:
:My attempt, at 79 characters:
:$\=$/;undef$/;$_=;s/.{70}//s;tr,01\n,\x00\xff,d;print$1while/(.{1,127})\n?
:/g;

Here's my go at 45 characters (including command line switches):

  perl -0lpe's/^.{71}|[\n\r]//gs,s/(.{127})/$1\n/g' stream.txt

If you pipe the output to less and scroll down at a consistent pace,
it's readable.

  Casey West

-- 
I have traveled the length and breadth of this country and talked
with the best people, and I can assure you that data processing is a
fad that won't last out the year.
 -- The editor in charge of business books for Prentice Hall, 1957



Golf challenge: decode CETI message

2002-01-09 Thread Patrick Gaskill

There's an article about CETI's next message into space

  http://slashdot.org/article.pl?sid=02/01/08/231247mode=nested

and CETI is providing the message in ASCII 1's and 0's (with example noise
added) to be decoded for our own amusement. Of course, I wrote a Perl script
to do this for me. Of more course, I golfed it.

The address of CETI's message is:
http://www3.sympatico.ca/stephane_dumas/CETI/output_stream.txt

You'll have to chop off the the first 70 characters, then remove any
newlines, and then add newlines after every 127th character. This program
assumes the input on STDIN, and the output going to STDOUT. I think that
should be enough details to run with this...

My attempt, at 79 characters:
$\=$/;undef$/;$_=;s/.{70}//s;tr,01\n,\x00\xff,d;print$1while/(.{1,127})\n?
/g;

Show them aliens what we're made of!

Patrick



Re: Golf challenge: decode CETI message

2002-01-09 Thread Keith C. Ivey

Patrick Gaskill [EMAIL PROTECTED] wrote:

 My attempt, at 79 characters:
 $\=$/;undef$/;$_=;s/.{70}//s;tr,01\n,\x00\xff,d;
 print$1while/(.{1,127})\n?/g;

Are we doing this without command-line switches?  This should
do the same in 65 characters:

$\=$,=$/;$/=x;$_=;s/.{70}//s;tr,01\n,\x0\xff,d;print/.{1,127}/g

But s'\x0\xff' @' to make it shorter and more visible on my system.

-- 
Keith C. Ivey [EMAIL PROTECTED]
Washington, DC