Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

99 Bottles of Beer take two

by Dylan (Monk)
on Dec 23, 2003 at 23:02 UTC ( #316737=obfuscated: print w/replies, xml ) Need Help??

The following code runs under strict and warnings, and prints "99 bottles of beer on the wall", etc. It's slow at first, but employs a caching system... It is a (better|worse) version of an earlier obfu of mine...
#/usr/bin/perl $a=100;XK:(--$a>1)&&($::m=($::m||sub {p($a,pack('c*', 0x62,0x6F,0x74,0x74,0x6C,0x65,0x73),w(0x18B),w(0x9717) ,w(0x193),w(0x35A4),w(0x62EFF),chr(0x2C));sub l{eval w(11292).w(383).q{(pack("c",0xA))}};p($a,pack('c*',0x62, 0x6F,0x74,0x74,0x6C,0x65,0x73),w(0x18B),w(0x9717),chr( 0x2C));p((w(0x560E6)),w(0x290C),w(0x13C9F).chr(0x2C),w (0x44F24),w(0xFD),join('',w(0x486),w(0x38E3)),chr(0x2C)) ;sub p {eval w(11292).w(383).q{(join(pack("c",0x20), "\u$_[0]",@_[1..($#_-1)]).$_[-1].pack("c",0xA))}};p($a -1,($a-1)==1?chr(0x62).chr(0x6F).chr(0x74).chr(0x74).chr (0x6C).chr(0x65):pack('c*',0x62,0x6F,0x74,0x74,0x6C,0x65, 0x73),w(0x18B),w(0x9717),w(0x193),w(0x35A4),w(0x62EFF),chr (0x2E));eval w(11292).w(383).q{(pack("c",0xA))};goto XK;}) )->();%::qw=qw::;sub w {($::qw{$_[0]})&&(return$::qw{$_[0] });$b=$_[0];$_=chr(97);{if($b-->0){$_++;redo;}};$::qw{$_[ 0]}=$_;}p(1,chr(0x62).chr(0x6F).chr(0x74).chr(0x74).chr( 0x6C).chr(0x65),w(0x18B),w(0x9717),w(0x193),w(0x35A4),w( 0x62EFF),chr(0x2C));p(1,chr(0x62).chr(0x6F).chr(0x74).chr( 0x74).chr(0x6C).chr(0x65),w(0x18B),w(0x9717),chr(0x2C));p(( w(0x560E6)),w(0x290C),w(0x13C9F).chr(0x2C),w(0x44F24),w(0xFD) ,join('',w(0x486),w(0x38E3)),chr(0x2C));p((w(0x17A)),w( 0x3A5FC),pack('c*',0x62,0x6F,0x74,0x74,0x6C,0x65,0x73),w( 0x18B),w(0x9717),w(0x193),w(0x35A4),w(0x62EFF),chr(0x2E));

Replies are listed 'Best First'.
Re: 99 Bottles of Beer take two
by NetWallah (Abbot) on Dec 24, 2003 at 18:40 UTC
    It runs in under 2 seconds on my Win XP 700 Mhz machine, which is plenty fast (++).

    Now -- would'nt it be nice if it could use a text-to-speech engine, and actually RECITE the verse ?

    "When you are faced with a dilemma, might as well make dilemmanade. "

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://316737]
Approved by davido
[Corion]: choroboa: A good choice! ;)
[Corion]: I still somewhat wonder if it were worthwhile to replace init / systemd by make with a simple? Makefile listing the dependencies ...
[Discipulus]: i have a different opinion: automation is always worth: first i can use Perl (and this is good), then later you can reuse parts to automate others tasks. My $boss everytime say:'how much time you spend doing this?' So generally i present a perl solution
[Corion]: Discipulus: Yes, but the chart gives some limits on whether it's really worth spending time for saving your time. If you gain enjoyment, automating is still great, but it doesn't save time ;)
[Discipulus]: Corion are you would able to realize such thing? O_O
[Corion]: In the same vein I have a script that automates Firefox to enter some data into another system. It's not faster than the people using the script if they were to do it manually, but they prefer not having to check the data and not having typos when ...
[Corion]: ... entering the data

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-07-27 09:24 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (408 votes). Check out past polls.