Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

JAPH / Perl Rube Goldberg Machine

by eighty-one (Curate)
on Dec 10, 2008 at 16:51 UTC ( [id://729452]=obfuscated: print w/replies, xml ) Need Help??

This script performs a simple task in a needlessly complex manner.

I derived this from some work I did out of spite to annoy a Python-programming friend after a discussion about brackets :)

#!/usr/bin/perl -w use strict; my $japh=<<JAPH [}{{[} {] [] ][[]}] [}[{{] {{ {] {] [[ }{ [] }] {] {]{}]} [} {{ [} {] [] ][ [] }] [}[{{] {{[}[[ [] {}{] ]{ {] [}[{]][} [[[}{} [} [{ {][}{] ][{}]} [} {{ [}{] [] ][ [] }] [} [{ {] {{ {] [}{]{{{] [} {} ]} [} {{ [} {][]][[] }][}[{ {]{{[} [[ [] {} {]]{ {] [} [{ {[ [] }] [] }} [} [{ [] ]{ [][[[}{] {] [} {] ][{}]} [} {{ [}{][] ][[]}] [}[{{] {{ {] {] [[ }{ [] }] {]{]{} ]}[}{{ [}{][] ][ [] }] [} [{ {] {{ [}[[[] {} {] ]{{][} [[ {{ [][[ [}{][] }{ {] [}{]][ {}]}[} {{ [} {] [] ][ [] }] [} [{ {] {{{][}{] {{{][}{} ]} [}{{ [}{][] ][[]} ][ }[ {{ ]{ {[ }[ [[ ]{ }{ ]] {{ ][ }[ {] {[]{[[ ]{ }[ ]]}[][ [[ }{ ]{][}{]][{}]}[}{{[}{][]][[]}][}[{{]{{{]{][[}{[]}]{]{]{}]} JAPH ;my $l=''; my $o='';foreach($japh){chomp; my $len= length($_);for(my $p=0;$p<$len;$p++){ my $b=substr ($_,$p,1); if($b eq ' '){ next;}$o.= b2bin($b);if( length($o) == 8){$l.=pack('B8',$o);$o ='';}}}eval( $l);sub b2bin {my $b = shift; if($b eq '{'){return '00';} elsif($b eq '['){ return '01';} elsif($b eq ']'){return '10';}elsif($b eq '}'){return '11'; }}

Replies are listed 'Best First'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-04-23 13:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found