99 Bottles of Beer make you verrrry happy

Tim Robinson (old mirror) collects programs in (now over 300) different languages, that simple print some non-sense about 99 bottles of beer.
There is also someone who did this in procmail.

Verrry cooool stuff - so me thought me should contribute to this in the BigInt way. Because, BigBottles of BigBeer must be even better than normal bottles of ordinary beer ;)

Back to my Perl Projects.

99 BigBottles of StringBeer (2001-01-06)

#!/usr/bin/perl -w

use Math::String 1.16;
use Math::BigInt 1.48;

my $i = Math::String->new('99',['0'..'9']);             # counter
my $cs = ["a".."z","A".."Z"," ",",","(",")","\n"];      # charset
my $c = 'Math::String';                                 # class
my $u = $c->from_number(                                # b. of beer on wall
       "143457256751672444408485136195337476997885002593618110354",$cs);
my $v = $c->from_number(                                # take one, pass it
       "2183742159727155773060245326632596445683097582725669500",$cs);
my $w = $c->from_number(                                # bottles of beer
       "121961920301233380909600391518980493",$cs); 

while ($i ne '00') { print "$i$u$i$w$v"; $i--; print "$i$u\n"; }


Last update: 2002-01-09