#!/usr/bin/perl -w # Object Oriented? use strict; package # a ball? ball;my%bal;sub # is a ball an object? new{shift;my@ball=@_; # maybe... but what if it for(my$ball=0;$ball<@ball # gets lost... how can you ;$ball++){if(!$ball<16){$ball # prove it was there in the [$ball]=~s+(.{31}).*+$1+x;$,="" # first place? ;}$ball[$ball]=~y=a-lmn-zA-Z=x= if($ball<16);my $b;$ball[$ball] # =~y=!-@[-_{-~=x=; $ball[$ball ## ]=~s+x\sx+xxx+gx if($ball <16 );$ball[$ball]=~s+.*+ s!.* !!x+sex unless( $ball # a banana? <16&& $ ball>2 # is a banana );$ball[ # an object? $ball]=~ # maybe... but s+1++gx;}; # what if it print@ball} # gets eaten.. package main # how can you ;;;;open(OUT, # prove it was $0 );; my @in; # there in the @ in= <OUT> ;; # first place? package banana; ;sub new{shift; my @banana=@_;; map( y=!-~=x=,@ banana);map(s+x s?\sx+xxx+gx, @ banana);for (my$ banana=10; $banana <@banana;$banana++){ if($banana<37){substr ($banana [$banana ] ,0, 41-$ banana)=~ y=!-~= =; ;; $banana[$banana] =~s+(.{53}).*+$1+; # a lamp? print $banana[$banana] # is a lamp ;}}}package lamp;;sub new{ # an object? my$lamp={}; my@lamp=@_[39..63] # maybe... ;$lamp->{lamp}=[@lamp]; grep (map( # but what if y=!-~=x=, @{$lamp->{lamp}}), @{$lamp-> # it gets {lamp}});;; grep(map (s/x\sx/xxx/, @{$lamp-> # turned off? {lamp}}),@{$lamp->{lamp}});for(my$lamp1=0; $lamp1< # how can you @{$lamp->{lamp}};$lamp1++){substr($lamp->{lamp}->[ # prove it was $lamp1],0,15-$lamp)=~y=!-~= = if($lamp>15);$lamp-> # there in the {lamp}->[$lamp1]=~ # first place? s+(.{53}).*+$1+x ; } bless $lamp;}; ; sub return_data{my $lamp=shift;return @{$lamp->{lamp}};} package main;while (){print ">";$_=<> ;$_= new ball(@in) if(/^ball$/) ;$_ = new banana(@in) if (/^banana$/);if(/^ ob(ject)?ive$/x ){ my@object=qw/real? even anything Is object? an really anything Is/;;$, # a block? =" ";print reverse @ object # is a block an object? ;;print "\n";};if(/^lamp$/) # maybe... but what if it {$_=new lamp(@in);;print($_ # crumbles? how can you ->return_data)}if(/^block$/ # prove it was there in the ){my@block=@in;map(y= -~=x= # first place? ,@block);; for(my$block=65; $block<$#block+1;$block++){ $block[$block]=~s+(.{27}).* +$1+x;print$block[$block]}} exit if(/^exit$/)}close OUT

This obfu is command driven (meaning you have to type stuff to make it do stuff). The commands are:

  1. ball
  2. banana
  3. lamp
  4. block
  5. exit
  6. and a secret (ok maybe not too secret...) command!

Things to note:

  1. Please dl code rather than copy/paste (or if you MUST copy/paste, put a blank line at the end)
  2. Either way, please save to a file and run from there.
  3. Don't vote just because of the presentation ascii... I think it makes it look cool (and its a lot more work to do) but theres more to this piece than that. Also, I welcome anyone who would like to review/decipher it!

Update: Run the program, and THEN input the commands. It has sort of a mini-shell. Don't try to input the commands with command line flags, because it wont work :)


In reply to Object Oriented? by jryan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.