develooper Front page | perl.fwp | Postings from May 2003

Re: 99 bottles of beer on the wall

From:
Casey West
Date:
May 23, 2003 13:56
Subject:
Re: 99 bottles of beer on the wall
Message ID:
20030523210151.GF43110@geeknest.com
It was Friday, May 23, 2003 when Zed Lopez took the soap box, saying:
: OK, here's some pure frivolousness.
: 
: http://99-bottles-of-beer.ls-la.net/ has hundreds of examples of
: programs to output 99 bottles of beer on the wall, including several
: in Perl under:
: 
: http://99-bottles-of-beer.ls-la.net/p.html
: 
: What's your lowest golf score to solve it?

It's not the smallest solution, but I find it esthetically pleasing.

  $_=''.q;enq!%,)qdudqrd!2//::*z%1>,)%,=::''ppZ%,!ansskdr!ne!addq!nm!sgd!v`kk
  /[m[m\*/ppZ%,!ansskdr!ne!addq!nm!sgd!v`kk-[m%,!ansskdr!ne!addq-[mS`jd!nmd!c
  nvm-!o`rr!hs!`qntmc-[m\<)%,>>2''%1>}r0dr0d0f*<%z(##(|/>%1!|%z(##(|/>=EBSB?<
  oqhms%z(##(|;;s;\n;;g=>s;(.);chr ord($1)+(ord($1)<76?-1:1);ge=>eval __END__
  No more bottles of beer on the wall.

But this exercise has become dull since I learned about HQ9+[0], and
subsequently wrote an interpreter[1] for the language.  Here is my entry in
HQ9+.

  9

[0] http://www.cliff.biffle.org/esoterica/hq9plus.html
[1] http://search.cpan.org/CPAN/authors/id/C/CW/CWEST/HQ9PLUS-0.2.tar.gz

  Casey West

-- 
Shooting yourself in the foot with Assembly Language 
You crash the OS and overwrite the root disk. The system administrator
arrives and shoots you in the foot. After a moment of contemplation,
the administrator shoots himself in the foot and then hops around the
room rabidly shooting at everyone in sight. 




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About