Newsgroups: comp.lang.clipper,comp.lang.clos,comp.lang.clu,comp.lang.cobol,comp.lang.dylan,comp.lang.eiffel,comp.lang.forth,comp.lang.forth.mac,comp.lang.fortran,comp.lang.functional,comp.lang.hermes,comp.lang.icon,comp.lang.idl,comp.lang.idl-pvwave
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!howland.reston.ans.net!ix.netcom.com!netcom.com!wilbaden
From: wilbaden@netcom.com (W.Baden)
Subject: Re: 99 Bottles of Beer in COBOL85
Message-ID: <wilbadenDM0puJ.5Dz@netcom.com>
Followup-To: comp.lang.clipper,comp.lang.clos,comp.lang.clu,comp.lang.cobol,comp.lang.dylan,comp.lang.eiffel,comp.lang.forth,comp.lang.forth.mac,comp.lang.fortran,comp.lang.functional,comp.lang.hermes,comp.lang.icon,comp.lang.idl,comp.lang.idl-pvwave
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <4e0fus$8rg@ionews.ionet.net> <4ej7o8$2mn@butch.lmsc.lockheed.com> <RJ.96Jan29230734@eli.wariat.org> <4ekqa2$ot2@yama.mcc.ac.uk> <4em8lr$8s8@cloner3.netcom.com>
Distribution: inet
Date: Tue, 30 Jan 1996 23:42:19 GMT
Lines: 36
Sender: wilbaden@netcom23.netcom.com
Xref: glinda.oz.cs.cmu.edu comp.lang.clipper:10575 comp.lang.clos:3658 comp.lang.clu:262 comp.lang.cobol:7659 comp.lang.dylan:6432 comp.lang.eiffel:12724 comp.lang.forth:26094 comp.lang.forth.mac:970 comp.lang.fortran:36955 comp.lang.functional:6985 comp.lang.hermes:293 comp.lang.icon:3363 comp.lang.idl:734 comp.lang.idl-pvwave:6099

\ At first I thought that this was a troll, but then I saw
\ the list of news-groups which it was posted.

\ This is an uncommon program whose readability is not
\ improved by factoring.

\ (It uses the portable but non-standard CASE ... THENS.)

: BOTTLES                                             ( n -- )
      0 SWAP DO                                             ( )
            CASE  I 2 > IF
                  I . ." bottles of beer on the wall, "
                  I . ." bottles of beer. " CR
                  ." Take one down and pass it around. " CR
                  I 1- . ." bottles of beer on the wall. " CR
            ELSE  I 2 = IF
                  I . ." bottles of beer on the wall, "
                  I . ." bottles of beer. " CR
                  ." Take one down and pass it around. " CR
                  ." One bottle of beer on the wall. " CR
            ELSE  I 1 = IF
                  ." One bottle of beer on the wall, "
                  ." one bottle of beer." CR
                  ." Take it down and pass it around. " CR
                  ." No more bottles of beer on the wall. " CR
            ELSE
                  ." No more bottles of beer on the wall, "
                  ." no more bottles of beer." CR
                  ." Go to the store and buy some more. " CR
                  ." 99 bottles of beer on the wall. " CR
            THENS
            CR
      -1 +LOOP
;

99 BOTTLES
