Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

bookkeeping

by petral (Curate)
on Jan 04, 2002 at 19:41 UTC ( [id://136284]=obfuscated: print w/replies, xml ) Need Help??

Sorry if you've heard this one before.

#!/usr/bin/perl print'<- Bookkeeping takes a couple of minutes and'. ' is best with 80 columns or more.->'; ( $ ~= q (sweettooth) ) =~ y (thow) (ptrl); $ ~=~ s (.....) ($& ); $ ~=~ s (( ..)..) ($+in); $ ~=~ s ( .+)($&$&); ($S,$T)= $ ~=~ m ((.+) (.+)); ($|)=( $ ~= q (00112 10211 1120011 1120110011101 1122012010 1202111 11212002011.00 1201111221011.00 1011111 20111 12011 11201211011.00 1201111200111.12 01100102121122011 20112020111.12 1200212010111.12 0110011101 1122011 11101100100.12 1202011112120.02 12101 12011 1120011 20111220111.21 0210201100020.11 02002 011000120011 10211201112.20 1110112002121.01 01 10002001 0200002 00102000020.01 0200001201012.20 ------------------- --------------------- 011000121201 1001001101220011.00 100011111111101112.12 1201000 11210020 1200211221 1121201100 12011 1120011 11201100120.20 1122111201111.11 01100 11110 1110111 21211112011.00 0200101211011.00 1112012 002112211121201 10002001012.11 0110002002012.11 011001112012 00211 22111 21201100020.02 0121101100020.10 0121101 10011 12012 00211221112.12 0110002010012.11 ------------------- --------------------- 011001201111 2001111201100020.01 020000121102000020.00 02000 0110012011 11200 1120111 22011 12112 01001220012.12 0110010111111.01 1122101100 1021112 10212012001.12 1001212100111.01 1121212 00011 2111111212 01002102011.00 0110001100012.20 01 10001 2200110001 22001100011.00 0110001100011.00 120111200201 2211110101 21212102100.01 0121211002012.21 0122112 0100211001 10001 10001100011.00 0110001100011.00 0110001110 011001110211 22111221112.10 1121011112111.12 12000 11112 1200201 10001212021.20 0110011102112.21 1121011112 1200011 11212002011.00 0110001100011.00 ------------------- --------------------- 012120110010 1110122001100102.21 111011121111211001.12 -------------------------------------------------------------------- ). ( '01100' x (( 1 + 2 * 2 * 2 + 1 ) * 2 * 2 * 2 - 1 )) . '00112' ) =~s( * *-* *-* * *(.)(. *.\.?..))(($ * =$+)=~y- .--d;$==$1;$ * =~s((.).)(($;="@{[(${ * &},$+)[-1..1]]}")=~s:.+.:${ * ;}=~s( ?(.))(+$+)g;${ * ;}:ee;$;)ge;++${$*[$-]}{$ * =$=.$*};$;+$;+$;==$ * &&++$-;$*)ge;$~=~s+...+$ * =$&;"(\$\\=\"\\".$ * .'")=~$"?'." $T: --\$".'{$ * [0-$-]}{$ * }==0?'." $T: $S;\$\\=~\"\r\"&&($S,$S)&&\$ --- " +gee


Won't work if there are any trailing spaces.  As usual, reports of difficulties/fixes for different platforms are welcome.
jmcnamara points out that I should mention it takes about 1 minute 45 secs to run.

update: Ok, this may work with any perl5 (tested down to a windows 5.001).   (Also obfu'd the code a little more and got it into better(?) shape.  --  Actually, the code is pretty straightforward, given the restrictions of only using the 5 shortest words in perl: m, q, s, x, and y; and only 0, 1, and 2.  And of course, the indentation is to a decorative purpose and almost all the variable names are punctuation, but other than that...)

  p

Replies are listed 'Best First'.
Re: bookkeeping
by jynx (Priest) on Jan 05, 2002 at 03:16 UTC

    Is it supposed to output something to screen?

    i've tried it on mac osx, redhat linux, and solaris 8 with perl5.6.0 on all three. i've tried with and without trailing spaces. i don't see anything offhand that would cause it to not run, but then again it's hard to debug something that doesn't seem to do anything.

    Is this for 5.6.1 or later? am i missing something about trailing whitespace? i figure i'm doing something wrong and that the code is fine, and with that assumption is there something i should do to get the code running?

    jynx

      Yes (er, no), qmax already told me he couldn't run it on one machine and we narrowed it down to 5.6.0.   Apparently, it runs on 5.03, 5.04, 5.05 and 5.6.1!   If I get a chance to snag a copy of 5.6.0 to install, I'll see if I can figure it out.   Also, It won't run on 5.01 (and I guess 5.02) because it's using (?<=.) in a regex. Sorry. :-(

        p
      OK, is it fixed now?   I think 5.6.0 was evaluating autoflush numerically instead of logically.

        p

        Yes!

        That's pretty interesting, i'll have fun trying to understand it :)

        jynx

Re: bookkeeping
by belden (Friar) on Jan 05, 2002 at 16:25 UTC
    Holy man, nice work on that. I look forward to seeing the spoiler for this obfu... (please, someone?) blyman
    setenv EXINIT 'set noai ts=2'
      Thanks.   You can start for yourself with   perl -MO=Deparse,-p,-x3,-i bookkeepingand
        perl -d bookkeeping
        p
Re: bookkeeping
by petral (Curate) on Jan 23, 2002 at 01:32 UTC
    Just to complete the record, if anyone wants to insert their own content and doesn't have a trinary-coded octal encoder handy, here's the one I used:
    #!/usr/local/bin/perl -w use strict; my @tr = ( '00', '01', '02', 10, 11, 12, 20, 21 ); for my $t (@ARGV) { $t =~ s{.}{ $_ = sprintf "%03o", ord $&; s/(?<=.)./$tr[$&]/g; $_." " }ge; $t =~ s/.{66}/$&\n/g; print $t . "00112\n"; }

      p

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-19 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found