Hopefully the result is almost as fun as the pleasure I had writing it.
sub p{print@_}$p="ITRS ZMNSGDQ ODQK GZBJDQ";$p=~y:ZA-Y:A-Z:;@a=split //,$p;@k=map{/\w/?'*':$_}@a;Z:until($v){p"$/\$$t: ",@k,$/;$n=int(rand (9))*100+100;p"Spin:\$$n. Guess letter, or phrase to solve$/";$g= <STDIN>;chomp($g=uc$g);if(length$g>1){if($g eq$p){$v++}else{$t=0}last Z}for(@k){if($g eq$_){p"Already used $g$/";next Z}}if($g=~/[AEIOUY]/ ){$t-=100;p"Vowel costs \$100$/";$n=0}$c=0;for($i=0;$i<@a;$i++){if($g eq$a[$i]){$t+=$n;$c++;$k[$i]=$a[$i]}}p"$c $g\'s.$/";$v++if join("",@k )eq$p}p@k,$/;if($v){p"Congrats, "}else{p"Wrong, "}p"win \$$t$/"
All it needs is Vanna White. Enjoy!!!
Dave
"If I had my life to do over again, I'd be a plumber." -- Albert Einstein
Interesting to me is the fact that while this code runs fine (and even ran under strictures before I took out the 'my' declarations), it won't deparse using B::Deparse, at least under Perl 5.8.0 on Win32. I typically deparse a script by removing the shebang line, and then running it as, perl -MO=Deparse script >deparsed. That approach fails with 'Can't call method "isa" without a package or object reference at C:/indigoperl/perl/lib/Deparse.pm line 1080. Check failed--call queue aborted.'
Stumping B::Deparse is trivial if eval is used, or fork or something like that. But this obfu doesn't use any unusual trickery that I expected to be capable of stifling B::Deparse.
This being an obfu (though not a terribly obscure one at that), I consider the fact that it stumps B::Deparse a little added bonus.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl of Fortune
by nimdokk (Vicar) on Sep 11, 2003 at 23:42 UTC | |
|
Re: Perl of Fortune
by barbie (Deacon) on Sep 12, 2003 at 11:59 UTC | |
by Grygonos (Chaplain) on Sep 12, 2003 at 16:35 UTC | |
|
Re: Perl of Fortune
by dmitri (Priest) on Sep 11, 2003 at 21:49 UTC |