99 Bottles of Beer
One program in 571 languages
 
     
  Submit new example     Change log     History     Links     Tip: internet.ls-la.net     Thanks, Oliver     Guestbook      
Choose languages starting with letter:
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
HackMongo   HAL/S   HanoiLove   Haskell   hBefunge   Hope   Hot Soup Processer   HotTEA   Hourglass   HP 48 Calculator   HP 9825A Calculator   HQ9+   HSC (iterative)   HSC (recursive)   HTA   HTBasic   HTML/OS   Hummingbird Basic   HyperCard  
 
  Programming language: HackMongo
 
hackMongo is an extension of the Mongo plotting package

! Does the beer song... sends output to a postscript file
! Geza Gyuk - gyuk@oddjob.uchicago.edu

printer 1
erase

data beer.dat
setv rounds c1(1)                       ! get number of rounds
                                        ! from first line, first
setv container bottles                  ! column of file beer.dat
expand {5/rounds}
loop i {rounds} 2 -1
   relocate 0.1 {i*5/(5*rounds)}
   putlabel 6 {i} bottles of beer on the wall,
   relocate 0.1 {(i*5-1)/(5*rounds)}
   putlabel 6 {i} bottles of beer,
   relocate 0.1 {(i*5-2)/(5*rounds)}
   putlabel 6 take one down and pass it around,
   if ({i}=2) setv container bottle
   relocate 0.1 {(i*5-3)/(5*rounds)}
   putlabel 6 {i-1} {container} of beer on the wall.
   relocate 0.1 {(i*5-4)/(5*rounds)}
   putlabel 6
endloop

relocate 0.1 {5/(5*rounds)}
putlabel 6 1 bottle of beer on the wall,
relocate 0.1 {4/(5*rounds)}
putlabel 6 1 bottle of beer,
relocate 0.1 {3/(5*rounds)}
putlabel 6 take it down and pass it around,
relocate 0.1 {2/(5*rounds)}
putlabel 6 no more bottles of beer on the wall.

hardcopy
end
 
  Programming language: HAL/S
 
C 2003 RUPERT SCAMMELL / PUBLIC DOMAIN
C THIS PROGRAM WILL PRINT THE POPULAR FOLK SONG
C 99 BOTTLES OF BEER ON THE WALL IN THE HAL/S
C PROGRAMMING LANGUAGE, A REAL TIME FLIGHT CONTROL
C LANGUAGE PRIMARILY USED FOR FLIGHT CONTROL SOFTWARE ON
C US SPACE SHUTTLES.
C FOR MORE INFO, SEE http://www.netcomuk.co.uk/~spaceuk/hals/hals.html
                                                                                   
NINETY_NINE_BOTTLES:
PROGRAM;
        DECLARE NUM_BOTTLES INTEGER;
        DECLARE BBWALL CHAR(30);
        DECLARE BBEER CHAR(30);
        DECLARE TWDOWN CHAR(50);
        BBWALL = ' Bottles of Beer on the Wall';
        BBEER = ' Bottles of Beer';
        TWDOWN = 'Take one down, and pass it around...';
                                                                                   
        DO NUM_BOTTLES = 100 TO 1 BY -1:
                WRITE(6) NUM_BOTTLES||BBWALL;
                WRITE(6) NUM_BOTTLES||BBEER;
                WRITE(6) TWDOWN;
        END;
        WRITE(6) 'NO MORE BOTTLES OF BEER ON THE WALL!'
CLOSE NINETY_NINE_BOTTLES;
 
  Programming language: HanoiLove
 
See http://www.azstarnet.com/~jeffryj/hanoi.txt for an explanation of 
this crude language.

This is originally one single line.

..,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......
'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.
..,.;'...,.;'.....,...'....,...`.'......,!...;..,.'.....'..,'...:..,...'....
..'..,'...:.,...`.'......,!...;...,...'......'..,'...:.,...`.'......,!...;..
,.'...,.'.....'..,'...:..,...'...,.;'.....,...'...,.;'....,.'...,.'...,...`.
'......,!...;...,...'.....,...'......'..,'...:.,.'...,.'..,.;'.....,...'....
.,...'....,...`.'......,!...;...,...'.....,...'.....,...'......'..,'...:.,..
.`.'......,!...;..,.'...,.'...,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
.,.;'...,.;'...,.;'....,.'.....'..,'...:..,...'.....,...'.....,...'...,.;'..
.,.'...,.'.....'..,'...:..,...'...,.;'.....,...'......'..,'...:.,...`.'....
..,!...;..,.'...,.'...,...`.'......,!...;...,...'......'..,'...:.,.'..,.;'..
...,...'....,...`.'......,!...;...,...'......'..,'...:.,.'...,.'..,.;'...,.;
'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'.....,...
'.....,...'...,.;'....,.'...,...`.'......,!...;..,.'...,.'...,...`.'....,.'.
..,...`.'......,!...;.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.
..,.;'.....,...'......'..,'...:.,.'...,...`.'.....,...'....,...`.'......,!..
.;...,...'.....,...'...,.;'.....,...'......'..,'...:.,.'.....'..,'...:.,...`
.'......,!...;..,.'...,.'..,.;'.....,...'.....,...'.....,...'....,...`.'....
..,!...;...,...'......'..,'...:.,...`.'......,!...;.,.;'....,.'...,.'.....'.
.,'...:..,...'...,.;'.....,...'....,...`.'....,.'...,.'...,...`.'......,!...
;..,.'...,.'...,.'.....'..,'...:..,...'.....,...'...,.;'.....,...'...,.;'...
.,.'...,.'...,.'...,...`.'......,!...;...,...'.....,...'.....,...'......'..,
'...:.,.'...,.'...,.'..,.;'.....,...'.....,...'.....,...'....,...`.'......,!
...;...,...'......'..,'...:.,.'..,.;'.....,...'....,...`.'......,!...;..,.'.
..,.'...,...`.'......'..,'...:..,...'......'..,'...:.,...`.'......,!...;..,.
'.....'..,'...:.,...`.'......,!...;....,!...;...,...'.....,...'...,.;'....,.
'.....'..,'...:..,...'......'..,'...:.,...`.'......,!...;..,.'...,...`.'....
..,!...;..,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'.
.,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'....,.'..,.;'...,.;'...,
.;'...,.;'...,.;'...,.;'.....,...'.....,...'....,...`.'......,!...;...,...'.
....,...'.....,...'......'..,'...:..,...'...,.;'.....,...'...,.;'....,.'...,
.'...,...`.'......,!...;...,...'.....,...'......'..,'...:.,.'...,.'..,.;'...
..,...'.....,...'....,...`.'......,!...;..,.'.....'..,'...:.,.'...,.'...,.'.
..,.'...,.'...,'"'.....,...'.....,...'.....,...'.....,...'.....,...'....,...
`.'......,!...;..,.'...,.'...,.'...,.'...,.'...,.'...,'"'.....,...'.....,...
'......'..,'...:.,...`.'......,!...;...,...'......'..,'...:.,...`.'......,!.
..;.,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'.
..,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...;..,.'...,'"'....
.,...'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...
,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...;..,.'..,.;'
...,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.
,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'.
...,...`.'......,!...;..,.'...,'"'.....,...'....,.'..,.;'...,.;'...,.;'...,.
;'...,.;'....,'"'....,'"'....,...`.'....,...`.'....,...`.'....,...`.'....,..
.`.'....,...`.'....,...`.'....,...`.'....,'"'....,...`.'....,...`.'....,...`
.'....,...`.'....,...`.'....,...`.'....,...`.'....,'"'.....,...'.....,...'..
....'..,'...:..,...'.....,...'...,.;'.....,...'...,.;'....,.'...,.'...,.'...
,...`.'......,!...;...,...'.....,...'.....,...'......'..,'...:.,.'...,.'...,
'..,.;'.....,...'.....,...'.....,...'....,...`.'......,!...;..,.'.....'..,'
...:.,.'...,.'...,.'...,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'....,'"'.....,...'.....,...'.
....,...'.....,...'....,...`.'......,!...;..,.'...,.'...,.'...,.'.....'..,'.
..:.,...`.'......,!...;...,...'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,
.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`
.'......,!...;..,.'...,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.
;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'
...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...;..,.'...,...`.'
....,...`.'....,'"'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'..
..,...`.'....,...`.'....,...`.'....,...`.'....,'"'.....,...'...,.;'...,.;'..
.,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.'...
.,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'..
.,...`.'.....,...'....,...`.'......,!...;..,.'...,'"'.....,...'...,.;'...,.
;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'
...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......
,!...;..,.'...,'"'...,.;'...,.;'...,.;'....,'"'....,'"'...,.;'...,.;'...,.;'
...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'....,'
"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'.
.,'...:.,.'...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'
....,...`.'....,...`.'....,...`.'....,...`.'.....,...'....,...`.'......,!...
;..,.'...,...`.'....,...`.'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...
,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.
;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...;..,.'.
..,...`.'....,...`.'....,'"'....,...`.'....,'"'.....,...'...,.;'...,.;'...,.
;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.
'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`
.'....,...`.'.....,...'....,...`.'......,!...;..,.'..,.;'...,.;'....,'"'....
.,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...
:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
...,...'....,...`.'......,!...;..,.'..,.;'...,.;'...,.;'...,.;'....,'"'....,
...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....
,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,'"'....,...`.'....,.
..`.'....,...`.'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'
...,.;'......'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,...`.'....,..
.`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,...'....,..
.`.'......,!...;..,.'..,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...
,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.
;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...
;..,.'...,...`.'....,'"'.....,...'...,.;'...,.;'......'..,'...:.,.'...,...`.
'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`
.'....,...`.'....,...`.'....,...`.'.....,...'....,...`.'......,!...;..,.'...
,'"'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
.,.;'....,'"'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...
,.;'...,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,..
.`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,
...'....,...`.'......,!...;..,.'...,...`.'....,...`.'....,...`.'....,...`.'.
...,...`.'....,'"'....,...`.'....,...`.'....,...`.'....,'"'.....,...'.....,.
..'.....,...'......'..,'...:..,...'...,.;'.....,...'...,.;'....,.'...,.'...,
...`.'......,!...;...,...'.....,...'......'..,'...:.,.'...,.'..,.;'.....,...
'.....,...'....,...`.'......,!...;..,.'.....'..,'...:.,.'...,.'...,.'...,.'.
.,.'...,'"'.....,...'.....,...'.....,...'.....,...'.....,...'....,...`.'...
...,!...;..,.'...,.'...,.'...,.'...,.'...,.'...,'"'.....,...'.....,...'.....
,...'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,
.;'...,.;'...,.;'.....,...'....,...`.'......,!...;..,.'...,...`.'....,...`.'
....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.
;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...
;..,.'..,.;'...,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'....
..'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;
'.....,...'....,...`.'......,!...;..,.'...,'"'.....,...'....,.'..,.;'...,.;'
...,.;'...,.;'...,.;'....,'"'....,'"'....,...`.'....,...`.'....,...`.'....,.
..`.'....,...`.'....,...`.'....,...`.'....,...`.'....,'"'....,...`.'....,...
`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,'"'.....,...'
.....,...'......'..,'...:..,...'.....,...'...,.;'.....,...'...,.;'....,.'...
,.'...,.'...,...`.'......,!...;...,...'.....,...'.....,...'......'..,'...:.,
.'...,.'...,.'..,.;'.....,...'.....,...'.....,...'....,...`.'......,!...;..,
.'.....'..,'...:.,.'...,.'...,.'...,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,
.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'....,'"'.....,...
'.....,...'.....,...'.....,...'....,...`.'......,!...;..,.'...,.'...,.'...,.
'.....'..,'...:.,...`.'......,!...;...,...'...,.;'...,.;'...,.;'...,.;'.....
'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,.
..'....,...`.'......,!...;..,.'...,'"'.....,...'...,.;'...,.;'...,.;'...,.;'
...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'..
.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...;..,
.'...,...`.'....,...`.'....,'"'....,...`.'....,...`.'....,...`.'....,...`.'.
...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,'"'.....,...'...,
.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'...,...`.'..
..,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.
...,...`.'....,...`.'.....,...'....,...`.'......,!...;..,.'...,'"'.....,...'
...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'..
.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,
...`.'......,!...;..,.'...,'"'...,.;'...,.;'...,.;'....,'"'....,'"'...,.;'..
.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.
..,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...
,.;'...,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,..
.`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,
...'....,...`.'......,!...;..,.'...,...`.'....,'"'....,...`.'....,...`.'....
,...`.'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
...'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,
.;'...,.;'.....,...'....,...`.'......,!...;..,.'..,.;'...,.;'...,.;'...,.;'.
...,'"'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;
'...,.;'...,.;'...,.;'....,'"'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,
.;'...,.;'...,.;'...,.;'....,'"'....,...`.'....,...`.'....,...`.'....,...`.'
....,...`.'....,...`.'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'.
..,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,...`.'.
...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,...'.
...,...`.'......,!...;..,.'..,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,
.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;
'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...;
..,.'...,...`.'....,'"'....,...`.'....,'"'....,...`.'....,...`.'....,...`.'.
...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,'"'...
..,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'.
..,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.
...,...`.'....,...`.'....,...`.'.....,...'....,...`.'......,!...;..,.'..,.;'
....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..
,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,
.;'.....,...'....,...`.'......,!...;..,.'...,...`.'....,...`.'....,'"'...,.;
'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'....,
'"'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'....,'"'....,...`
'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...
`.'....,...`.'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
.,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,...`.'..
..,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,...'..
..,...`.'......,!...;..,.'..,.;'...,.;'....,'"'.....,...'...,.;'...,.;'...,.
;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'
...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......
,!...;..,.'...,'"'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
.,.;'...,.;'...,.;'...,.;'...,.;'....,'"'....,...`.'....,...`.'....,...`.'..
..,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.
...,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,
'...:.,.'...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'..
..,...`.'....,...`.'....,...`.'....,...`.'.....,...'....,...`.'......,!...;.
.,.'..,.;'...,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;
'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.
..,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...;..,.'...,'"'....
.,...'...,.;'...,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.'....,...`
.'....,...`.'....,...`.'.....,...'....,...`.'......,!...;..,.'...,'"'.....,.
..'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;
'...,.;'.....,...'....,...`.'......,!...;..,.'...,'"'....,'"'.....,...'...,.
;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.
'...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.
'....,...`.'....,...`.'.....,...'....,...`.'......,!...;..,.'...,...`.'....,
...`.'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...
...'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.
;'...,.;'.....,...'....,...`.'......,!...;..,.'..,.;'...,.;'...,.;'....,'"'.
..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'
....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
....'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,
...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,...'....,
...`.'......,!...;..,.'..,.;'...,.;'...,.;'...,.;'....,'"'.....,...'...,.;'.
..,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...
,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,.
..`.'......,!...;..,.'...,'"'.....,...'...,.;'...,.;'...,.;'......'..,'...:.
,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...
;..,.'...,...`.'....,'"'....,...`.'....,...`.'....,...`.'....,'"'...,.;'...,
.;'...,.;'...,.;'...,.;'...,.;'....,'"'....,...`.'....,...`.'....,...`.'....
,...`.'....,...`.'....,...`.'....,...`.'....,'"'....,...`.'....,...`.'....,.
.`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,
...`.'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...
,.;'......'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,...`.'....,...`.
'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,...
'....,...`.'......,!...;..,.'..,.;'....,'"'....,...`.'....,...`.'....,...`.'
....,'"'......'..,'...:.,...`.'......,!...;..,.'...,.'...,.'...,...`.'.....,
...'......'..,'...:.,...`.'......,!...;...,...'......'..,'...:.,...`.'......
,!...;..,.'...,.'.....'..,'...:..,...'...,.;'.....,...'...,.;'....,.'...,.'.
..,...`.'......,!...;...,...'.....,...'......'..,'...:.,.'...,.'..,.;'.....,
...'.....,...'....,...`.'......,!...;...,...'.....,...'.....,...'......'..,'
...:.,...`.'......,!...;..,.'...,.'...,.'..,.;'...,.;'...,.;'...,.;'...,.;'.
..,.;'...,.;'...,.;'...,.;'....,.'.....'..,'...:..,...'.....,...'.....,...'.
..,.;'....,.'...,.'.....'..,'...:..,...'...,.;'.....,...'......'..,'...:.,..
.`.'......,!...;..,.'...,.'...,...`.'......,!...;...,...'......'..,'...:.,.'
..,.;'.....,...'....,...`.'......,!...;...,...'......'..,'...:.,.'...,.'..,.
;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'.
....,...'.....,...'...,.;'....,.'...,...`.'......,!...;..,.'...,.'...,...`.'
....,.'...,...`.'......,!...;.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'
..,.;'...,.;'.....,...'......'..,'...:.,.'...,...`.'.....,...'....,...`.'..
....,!...;...,...'.....,...'...,.;'.....,...'......'..,'...:.,.'.....'..,'..
.:.,...`.'......,!...;..,.'...,.'..,.;'.....,...'.....,...'.....,...'....,..
.`.'......,!...;...,...'......'..,'...:.,...`.'......,!...;.,.;'....,.'...,.
'.....'..,'...:..,...'...,.;'.....,...'....,...`.'....,.'...,.'...,...`.'...
...,!...;..,.'...,.'...,.'.....'..,'...:..,...'.....,...'...,.;'.....,...'..
.,.;'....,.'...,.'...,.'...,...`.'......,!...;...,...'.....,...'.....,...'..
....'..,'...:.,.'...,.'...,.'..,.;'.....,...'.....,...'.....,...'....,...`.'
......,!...;..,.'....,...'.....,...'......'..,'...:.,.'..,.;'.....,...'....,
...`.'......,!...;..,.'...,.'...,...`.'......'..,'...:..,...'......'..,'...:
.,...`.'......,!...;..,.'.....'..,'...:.,...`.'......,!...;....,!...;...,...
'.....,...'...,.;'....,.'.....'..,'...:..,...'......'..,'...:.,...`.'......,
!...;..,.'...,...`.'......,!...;..,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.
;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'
....,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'.....,...'....,...
`.'......,!...;...,...'.....,...'.....,...'......'..,'...:..,...'...,.;'....
.,...'...,.;'....,.'...,.'...,...`.'......,!...;...,...'.....,...'......'..,
'...:.,.'...,.'..,.;'.....,...'.....,...'....,...`.'......,!...;..,.'.....'.
.,'...:.,.'...,.'...,.'...,.'...,.'...,'"'.....,...'.....,...'.....,...'....
.,...'.....,...'....,...`.'......,!...;..,.'...,.'...,.'...,.'...,.'...,.'..
.,'"'.....,...'.....,...'......'..,'...:.,...`.'......,!...;...,...'......'.
.,'...:.,...`.'......,!...;.,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.
;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'....
..,!...;..,.'...,'"'.....,...'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.
'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.
'......,!...;..,.'..,.;'...,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;
'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.
..,.;'...,.;'.....,...'....,...`.'......,!...;..,.'...,'"'.....,...'....,.'.
.,.;'...,.;'...,.;'...,.;'...,.;'....,'"'....,'"'....,...`.'....,...`.'....,
..`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,'"'....,..
.`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,'
"'.....,...'.....,...'......'..,'...:..,...'.....,...'...,.;'.....,...'...,.
;'....,.'...,.'...,.'...,...`.'......,!...;...,...'.....,...'.....,...'.....
.'..,'...:.,.'...,.'...,.'..,.;'.....,...'.....,...'.....,...'....,...`.'...
...,!...;..,.'.....'..,'...:.,.'...,.'...,.'...,.'..,.;'...,.;'...,.;'...,.;
'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'....,
'"'.....,...'.....,...'.....,...'.....,...'....,...`.'......,!...;..,.'...,.
'...,.'...,.'.....'..,'...:.,...`.'......,!...;...,...'...,.;'...,.;'...,.;'
...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'..
.,.;'.....,...'....,...`.'......,!...;..,.'...,'"'.....,...'...,.;'...,.;'..
.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'...,
.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,...`.'...
...,!...;..,.'...,...`.'....,...`.'....,'"'....,...`.'....,...`.'....,...`.'
....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,'"'..
...,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'
...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'
....,...`.'....,...`.'....,...`.'.....,...'....,...`.'......,!...;..,.'...,'
"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,
.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...
..,...'....,...`.'......,!...;..,.'...,'"'...,.;'...,.;'...,.;'....,'"'....,
'"'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...
,.;'...,.;'...,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.
;'...,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,...`
.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,..
.'....,...`.'......,!...;..,.'...,...`.'....,...`.'....,'"'.....,...'...,.;'
...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'.
.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,...'....,
...`.'......,!...;..,.'...,...`.'....,...`.'....,'"'....,...`.'....,'"'.....
,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:
.,.'...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,..
.`.'....,...`.'....,...`.'....,...`.'.....,...'....,...`.'......,!...;..,.'.
.,.;'...,.;'....,'"'.....,...'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,
.;'...,.;'......'..,'...:.,.'..,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;
'...,.;'...,.;'...,.;'.....,...'....,...`.'......,!...;..,.'..,.;'...,.;'...
,.;'...,.;'....,'"'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'..
..,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.
...,'"'....,...`.'....,...`.'....,...`.'....,'"'.....,...'...,.;'...,.;'...,
.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'...,...`.'....,...`.'....,
...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....
,...`.'.....,...'....,...`.'......,!...;..,.'..,.;'....,'"'.....,...'...,.;'
...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'..,.;'..
.,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'.....,..
.'....,...`.'......,!...;..,.'...,...`.'....,'"'.....,...'...,.;'...,.;'....
..'..,'...:.,.'...,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,..
.`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'.....,...'....,..
.`.'......,!...;..,.'...,'"'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'...,.;
'...,.;'...,.;'...,.;'...,.;'....,'"'....,'"'.....,...'...,.;'...,.;'...,.;'
...,.;'...,.;'...,.;'...,.;'...,.;'...,.;'......'..,'...:.,.'...,...`.'....,
...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....,...`.'....
,...`.'....,...`.'.....,...'....,...`.'......,!...;..,.'...,...`.'....,...`.
'....,...`.'....,...`.'....,...`.'....,'"'....,...`.'....,...`.'....,...`.'.
...,'"'...,.;'...,.;'...,.;'....,'"'....,...`.'....,...`.'....,...`.'....,'"
'......'..,'...:.,...`.'......,!...;..,.'...,.'...,.'.....,!...;.
 
  Programming language: Haskell
 
module Main where

newtype Bottle = Bot Int

instance Show Bottle where
  show (Bot 0) = "No more bottles"
  show (Bot 1) = "1 bottle"
  show (Bot n) = show n ++ " bottles"

data Line = Simple String | Complex Bottle String

instance Show Line where
  show (Simple s)    = s
  show (Complex b s) = show b ++ s

verse n = [Complex (Bot n) " of beer on the wall,",
	   Complex (Bot n) " of beer.",
	   Simple "Take one down pass it around",
	   Complex (Bot $ n-1) " of beer on the wall.\n"]

main = do mapM print $ concatMap verse [99, 98 .. 1]
 
  Programming language: hBefunge
 
#!hbef
#by hmaon
#for http://bumba.net/~hmaon/hbef/
wid 80
hei 20
stack 1000
hb
b9*>:64s}}1+40jr"bottle"<
r"of beer on the wall"<"reeb fo"r
>}}2+ .0#@a04sbb+1s" s"cc+0s05sr
 <>;0a04sbb+1s" "cc+0s" enO"05s r s50"No more "s0+cc"s "s1+bbs40a0;
>","r "<"bb+1p","24p:02s">"bb+1p":"24p:02s07s05so"<"bb+1p"!"24p02sa,r
>}1+,05j
 >;r
>0a",dnuora ti ssap ,nwod eno ekaT"r
 
  Programming language: Hope
 
<a href=http://www-ala.doc.ic.ac.uk/~rap/Hope/>Click</a> for more information.

! Hope Version of 99 Bottles of Beer : RAM-Biter!!!
! Tested on a SPARC classic, SunSolaris 2 
! Programmer: Wolfgang Lohmann   wlohmann@informatik.uni-rostock.de
 
dec app  :( list ( char ) X list ( char )) -> list ( char ) ;
dec i2c  : num -> char;
dec i2s  : num -> list(char);
dec beer : num -> list(char);

--- app ( nil , w )
       <= w  ;
--- app (( a  ::  v ), w )
       <=( a  ::  app ( v , w )) ;

--- i2c(0) <= '0';
--- i2c(1) <= '1';
--- i2c(2) <= '2';
--- i2c(3) <= '3';
--- i2c(4) <= '4';
--- i2c(5) <= '5';
--- i2c(6) <= '6';
--- i2c(7) <= '7';
--- i2c(8) <= '8';
--- i2c(9) <= '9';

--- i2s(x) <= if x < 10 then [i2c(x)] else
				app(i2s(x div 10), i2s( x mod 10)); 

--- beer(x) <= if x = 1 then app( i2s(x), 
				" bottle of beer. No more beer on the wall.")
                	else app( app( app( app( app( 
				i2s(x), 
				" bottles of beer on the wall, "),
				i2s(x)), 
				" bottles of beer. "),
				"Take one down, pass it around. "), 
				beer(y))
                        where y== x-1;
 
  Programming language: Hot Soup Processer
 
;99 Bottles of beer in Hot Soup Processor.
;by Naoki Toyoshima May 14, 2003
;Hot Soup Processer -> http://www.onionsoft.net/hsp/hsp2dl.html

	for i,99,0,-1
	mes ""+i+"Bottle(s) of beer on the wall,"+i+"bottle(s) of beer."
	mes "Take one down and pass it around,"
	j=i-1
	mes ""+j+"bottle(s) of beer on the wall."
	next
	stop
 
  Programming language: HotTEA
 
' HotTEA version of 99 Bottles of beer (Bottles.hot)
' See http://www.mbay.net/~cereus7/tryit.html
' Philipp Winterberg, http://www.winterbergs.de
a = " bottle(s) of beer"; c = "on the wall"; l = 200; t = 100
PenColor 255,255,255; TextColor 0,0,255
FOR x = 1 TO 99
  DrawRect 100,0,300,600,FILLED
  DrawText 100-x, l, t; DrawText a, l+15, t
  DrawText c, l+80, t+15; DrawText ",", l+156, t+15
  DrawText 100-x, l, t+30; DrawText a, l+15, t+30;  DrawText ".", l+141, t+30
  DrawText "Take one down,", l, t+45; DrawText "pass it around,", l+80, t+60
  DrawText 99-x, l, t+75; DrawText a, l+15, t+75
  DrawText c, l+80, t+90; DrawText ".", l+156, t+90
NEXT x
 
  Programming language: Hourglass
 
;
; source/Beer
; Hourglass code for the 99 bottles of beer project!
; by David Croft <david@davidc.net>
;

define_variable"bottles"
define_variable"ply"
define_variable"players"

; this should match your capacities file
  players=32

  default

define_label"input"

  input ply

  reboot 253

  if ply>players then goto"new"

  ditch_player ply
  fe[ditch_player ply]

  goto"input"

define_label"new"

  ply-=players

  if ply>players then goto"input"

  select_player ply

  bottles=99

define_label"bottles1"

  $plural=""
  if bottles?1 then $plural="s"
  message 1

  bottles-=1

  if bottles>0 then message 2:goto"bottles1"

  message 3

  send_messages

  ditch_player ply
  fe[ditch_player ply]

  goto"input"
 
  Programming language: HP 48 Calculator
 
Courtesy Jeromy Carriere (jayc@bnr.ca)

<<
10 1 FOR k
IF k 1 == THEN
"1 bottle of beer on the wall."
"1 bottle of beer."
ELSE
"   bottles of beer on the wall."
1 k ->STR REPL
"   bottles of beer."
1 k ->STR REPL
END
"Take one down and pass it around."
IF k 1 == THEN
"No more bottles of beer on the wall."
ELSE
IF k 2 == THEN
"1 bottle of beer on the wall."
ELSE
"   bottles of beer on the wall."
1 k 1 - ->STR REPL
END
END
-1 STEP
>>
 
  Programming language: HP 9825A Calculator
 
Courtesy Tom Stepleton.  Replace "prt" with "dsp" to output song to the display instead of the printer.

0: for I=100 to 1 by -1
1: dim A$[5];str(I)->A$
2: prt A$&" bottles of beer on the wall"
3: prt A$&" bottles of beer"
4: prt "Take one down!"
5: prt "Pass it around!"
6: I-1->J
7: if J=0;prt "No more bottles of beer on the wall!";end
8: prt str(J)&" bottles of beer on the wall!"
9: next I
 
  Programming language: HQ9+
 
9
// http://www.cliff.biffle.org/esoterica/hq9plus.html
// Philipp Winterberg, http://www.winterbergs.de 
 
  Programming language: HSC (iterative)
 
<* 99-bottles-of-beer in HSC, by Matthias Bethke
   Pseudo-iterative version, process using:
   hsc xhtml compact 99bottles-iter.hsc *>

<$define PAGE:string/C="99 Bottles of Beer">

<$macro BOB N:num/R OTW:bool>
  <$if COND=(N = '0')>No more<$else><(N)></$if>
  <$if COND=(N <> '1')>bottles<$else>bottle</$if> of beer
  <$if COND=(set OTW)>on the wall</$if>
</$macro>

<$macro ITERATE COND:string/R CONTENT:string/R>
  <(
    "<$if COND=(" + COND + ")>" +
      "<(CONTENT)>" +
      "<ITERATE COND=(COND) CONTENT=(CONTENT)>" +
    "</$if>"
  )>
</$macro>

<$macro FOR /CLOSE VAR:string/R START:num=1 TO:num/R STEP:num=1>
  <("<$define " + VAR + ":num=" + START + ">")>
  <$if COND=(STEP < "0")>
    <ITERATE COND=(VAR + ">='" + TO +"'")
      CONTENT=(HSC.Content + "<$let " + VAR + "=(" + VAR + "&'" + STEP + "')>")>
  <$else>
    <ITERATE COND=(VAR + "<='" + TO +"'")
      CONTENT=(HSC.Content + "<$let " + VAR + "=(" + VAR + "&'" + STEP + "')>")>
  </$if>
</$macro>

<*** Page starts here ***>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html>
<head><title><(PAGE)></title></head>
<body>
<h1><(PAGE)></h1>
<FOR VAR=bottles START=99 TO=0 STEP=-1>
  <$if COND=(bottles = '0')>
    <p>Go to the store, buy some more...</p>
  <$else>
    <p><BOB N=(bottles) OTW>,<br />
    <BOB N=(bottles)><br />
    Take <$if COND=(bottles = '1')>it<$else>one</$if> down, pass it around,<br />
    <BOB N=(bottles - '1') OTW>.</p>
  </$if>
</for>
</body>
</html>
 
  Programming language: HSC (recursive)
 
<* 99-bottles-of-beer in HSC, by Matthias Bethke
   Recursive version *>

<$define PAGE:string/C="99 Bottles of Beer">

<$macro BOB N:num/R OTW:bool>
  <$if COND=(N = '0')>No more<$else><(N)></$if>
  <$if COND=(N <> '1')>bottles<$else>bottle</$if> of beer
  <$if COND=(set OTW)>on the wall</$if>
</$macro>

<$macro BINGE BOTTLES:num/R>
<$if COND=(BOTTLES = '0')>
  <p>Go to the store, buy some more...</p>
<$else>
  <p><BOB N=(BOTTLES) OTW>,<br />
  <BOB N=(BOTTLES)><br />
  Take <$if COND=(BOTTLES = '1')>it<$else>one</$if> down, pass it around,<br />
  <$let BOTTLES=(BOTTLES - '1')>
  <BOB N=(BOTTLES) OTW>.</p>
  <BINGE BOTTLES=(BOTTLES)>
</$if>
</$macro>

<*** Page starts here ***>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html>
<head><title><(PAGE)></title></head>
<body>
<h1><(PAGE)></h1>
<BINGE BOTTLES=99>
</body>
</html>
 
  Programming language: HTA
 
HTA = HTML Application
see http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp)

<!-- HTA version of 99 Bottles of beer (Bottles.hta) -->
<!-- Philipp Winterberg, http://www.winterbergs.de   -->
<html>
<head><hta:application id="99Bottles" singleInstance="yes"
applicationName="99 Bottles of Beer">
<title>99 Bottles of Beer</title></head>
<body><script><!--
for (b = 99 ; b > 0 ; b--) 
  with (window.document) {
    writeln(b + " bottle(s) of beer on the wall,<br>");
    writeln(b + " bottle(s) of beer.<br>");
    writeln("Take one down, pass it around,<br>");
    writeln((b - 1) + " bottle(s) of beer on the wall.<p>");
  } //-->
</script></body>
</html>

 
  Programming language: HTBasic
 
! HTBasic version of 99 Bottles of beer (Bottles.bas)
! See http://www.techsoft.de/htbasic/german/
! Philipp Winterberg, http://www.winterbergs.de

CLEAR SCREEN
DISPLAY FUNCTIONS OFF
A$=" bottle(s) of beer"
C$=" on the wall"
FOR B=99 TO 1 STEP -1
  PRINT B;A$;C$;","
  PRINT B;A$;"."
  PRINT "Take one down, pass it around,"
  PRINT B-1;A$;C$;".";CHR$(13);CHR$(10)
NEXT B
END
 
  Programming language: HTML/OS
 
See http://abooks.com/cgi-bin/htmlos.cgi/99bottles.html for working example
See http://aestiva.com/ for more informations about HTML/OS.

<HTML>

<<i=99
WHILE i > 0 DO
display i+" bottles of beer on the wall,<br>" /display
display i+" bottles of beer on the wall.<br>" /display
display "Take one down, pass it around,<br>" /display
i=i-1
display i+" bottles of beer on the wall.<br><br>" /display
/while
>>

</HTML>
 
  Programming language: Hummingbird Basic
 
' Hummingbird Basic version of the Beer Song
' By Eric Korpela (http://setiathome.ssl.berkeley.edu/~korpela)

Function DisplayBox(verse$, i%)
  If (i<>1) Then
    DisplayBox=Msgbox(verse, 4, "Verse")
  Else
    DisplayBox=Msgbox(verse, 0, "Verse")
  End If  
End Function

Function Plural$(i%)
  If (i%=1) Then Plural="" Else Plural="s" 
End Function

Function NewFormat$(i%)
  If (i%=0) Then NewFormat="No" Else NewFormat=Format(i%)
End Function

Sub Main
  Dim verse$, i%
  For i%=99 to 1 step -1
    verse=Format(i%) & " bottle" & Plural(i%) & " of beer on the wall." & chr$(13)
    verse=verse & Format(i%) & " bottle" & Plural(i%) & " of beer."& chr$(13) 
    verse=verse & "You take one down and pass it around" & chr$(13)
    verse=verse & NewFormat(i%-1) & " bottle" & Plural(i%-1) 
    verse=verse & " of beer on the wall." & chr$(13) & chr$(13)
    If (i<>1) Then verse=verse & "Drink more?"
    If (DisplayBox(verse, i)=7) Then 
      Msgbox "What a light weight!",48,"Wimp Out"
      Exit For
    End If 
  Next i%
End Sub
 
  Programming language: HyperCard
 
The scripting language for Apple's HyperCard.

--
-- a version of the "99 bottles of beer" song in HyperTalk
-- by eric carlson: eric@bungdabba.com
--
on BeerSong99
  BottlesOfBeer 99
end BeerSong99


--
-- do something with a lyric from the beer song.  this handler adds 
it to
--  a field on the current card
on OutputBeerLyric beerString
  if ( beerString is "<reset>" ) then
    put empty into cd fld "beer song"
  else
    put beerString & return after cd fld "beer song"
  end if
end OutputBeerLyric


--
-- sing the beer song with the specified number of bottles
on BottlesOfBeer bottleCount
  put bottleCount into initialCount
  OutputBeerLyric "<reset>"
  
  repeat until ( bottleCount < 1 )
    set cursor to busy     -- let 'em know this might take a while
    put BottleString(bottleCount) into currentString
    OutputBeerLyric currentString && "of beer on the wall,"
    OutputBeerLyric currentString && "of beer."
    OutputBeerLyric "Take one down, and pass it around,"
    
    subtract one from bottleCount
    OutputBeerLyric BottleString(bottleCount) && "of beer on the 
wall." & return
  end repeat
  
  OutputBeerLyric "Go to the store and buy some more..."
  OutputBeerLyric initialCount & " bottles of beer on the wall."
end BottlesOfBeer


--
-- return the bottle string appropriate for the current count
function BottleString bottleCount
  if ( bottleCount is 1 ) then
    return "1 bottle"
  else if ( bottleCount is 0 ) then
    return "no more bottles"
  else
    return bottleCount && "bottles"
  end if
end BottleString
 
  © Oliver Schade <os@ls-la.net>, Generated: 06.06.2003 17:38:32