From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from math.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with SMTP id TAA09228 for ; Sun, 29 Oct 1995 19:49:58 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA17123; Sun, 29 Oct 1995 03:27:28 -0500 Old-Return-Path: Resent-Date: Sun, 29 Oct 1995 03:22:08 -0500 Old-Return-Path: Message-Id: <199510290822.DAA02545@redwood.skiles.gatech.edu> X-Mailer: exmh version 1.6.4 10/10/95 To: zsh-users@math.gatech.edu Subject: 99 bottles of beer Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 29 Oct 1995 03:22:08 -0500 From: Richard Coleman Resent-Message-Id: <"CIIk71.0.IB4.Mfpam"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/113 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On the web page http://www.ionet.net/~timtroyr/funhouse/beer.html There are programs/scripts that will generate the words to "99 bottles of beer on the wall" in many different languages. Since there was a version for sh and 2 versions for csh, I decided we needed to submit one for zsh. This is what I came up with. Unfortunately it doesn't use any cool features of zsh. Any suggestions for improvement? #!/usr/local/bin/zsh # # zsh script version of 99 Bottles of Beer # by Richard Coleman printbottles() { local bottles if (($1 == 0)) then bottles="no more bottles of beer" elif (($1 == 1)) then bottles="1 bottle of beer" else bottles="$1 bottles of beer" fi print -n $bottles$2 } integer i=100 while((i > 0)) do printbottles $i " on the wall, " printbottles $i ".\n" ((i--)) print -n "Take one down, pass it around, " printbottles $i " on the wall.\n" done Richard Coleman coleman@math.gatech.edu