Using S-Plus code
for(i in 100:1){
if(i>1){
cat(i,"bottles of beer on the wall,",i,"bottles of beer\n")
cat("Take one down, pass it around\n")
cat(i-1,"bottles of beer on the wall\n",fill=TRUE)
}
else{
cat(i,"bottle of beer on the wall,",i,"bottle of beer\n")
cat("Take one down and pass it around\n")
cat("No bottles of beer on the wall!!\n",fill=TRUE)
}
}
COMMENT
"99 Bottles of Beer" in SAIL (popular on PDP-10s)
William Soley <soley@sun.com> 14-May-2003
;
BEGIN "99BOB"
REQUIRE "{}" DELIMITERS;
DEFINE crlf = {('15&'12)};
INTEGER n;
FOR n _ 99 STEP -1 UNTIL 1 DO
BEGIN "Loop"
STRING bottles;
bottles _ IF n > 1 THEN " bottles " ELSE " bottle ";
PRINT(n, bottles, "of beer on the wall.", crlf);
PRINT(n, bottles, "of beer,", crlf);
PRINT("take one down, pass it around,", crlf);
END "Loop";
PRINT("no more bottles of beer on the wall.", crlf);
END "99BOB"
SAOL is the music-synthesis language which is part of the MPEG-4
standard. There's a homepage for SAOL at http://sound.media.mit.edu
Orchestra (beer.saol) :
global {
srate 1000; // sip rate
krate 100; // beer rate
}
instr beer() {
ksig drink;
drink = kline(99,1,1);
if (drink == 0) {
kdump("No bottles of beer on the wall.");
kdump("Everybody's drunk!");
turnoff;
}
else {
if (drink == 1) {
kdump(drink," bottle of beer on the wall.");
kdump(drink," bottle of beer.");
}
else {
kdump(drink," bottles of beer on the wall.");
kdump(drink," bottles of beer.");
}
kdump("Take one down, pass it around,");
if (drink-1 == 1) {
kdump(drink-1," bottle of beer on the wall.");
}
else {
kdump(drink-1," bottles of beer on the wall.");
}
kdump();
}
}
------------
Score (beer.sasl) :
0 beer 1
/* SAS version of 99 bottles of beer */
/* by Whitey (whitey@netcom.com) - 06/05/95 */
data _null_;
do i = 99 to 1 by -1;
put i 'bottles of beer on the wall,' i 'bottles of beer,';
put 'take one down, pass it around,';
j = i - 1;
if j = 0 then
put 'no more ' @;
else
put j @;
put 'bottles of beer on the wall.';
end;
run;
<a href=http://www.icsi.berkeley.edu/Sather>Click</a> for information.
-- Sather for 99 Bottles of Beer
--
-- David Stoutamire (davids@icsi.berkeley.edu)
class MAIN is
main is
loop
b::=99.downto!(1);
#OUT + bob(b) + " on the wall, "
+ bob(b) + ".\n"
+ "Take one down, pass it around, "
+ bob(b-1) + " on the wall.\n\n";
end
end;
bob(i:INT):STR is
case i
when 0 then return "no more bottles of beer";
when 1 then return "1 bottle of beer";
else return i.str + " bottles of beer";
end
end
end
Home-brew language. See
http://keaggy.intmed.mcw.edu/saul.html for details
;
; 99 Bottles of Beer in SAUL
; (http://keaggy.intmed.mcw.edu/saul.html)
;
; RTK, rkneusel@post.its.mcw.edu, 10-Apr-97
;
fixn(0)
setn(n,99)
:loop, putn(n)
disp(` bottles of beer on the wall, `)
putn(n)
disp(` bottles of beer.`)
putc(13)
disp(`Take one down, pass it around, `)
subt(n,1,m)
putn(m)
comp(m,1)
brne(:here)
disp(` bottle of beer on the wall.`)
jump(:there)
:here, disp(` bottles of beer on the wall.`)
:there,putc(13)
putc(13)
comp(n,2)
breq(:last)
subt(n,1,n)
jump(:loop)
:last, disp(`1 bottle of beer on the wall, 1 bottle of beer.`)
putc(13)
disp(`Take one down, pass it around, `)
disp(`no more bottles of beer on the wall.`)
endp
' ScriptBasic version of 99 Bottles of beer (Bottles.bas)
' See http://script.basic.hu/html/index.html
' Philipp Winterberg, http://www.winterbergs.de
a$ = " \98\111\116\116\108\101\40\115\41\32\111\102\32\98\101\101\114"
c$ = " \111\110\32\116\104\101\32\119\97\108\108\99\32\32\8\8\8\8\108"
for b = 99 to 1 step -1
print "\13\10",b,a$,c$,"\44\n",b,a$,"\46\n\84\97\107\101\32\111\110"
print "\101\32\100\111\119\110", ",\32\112\97\115\115\32\105\116\32"
print "\97\114\111\117\110\100\44\13\10",(b-1),a$,c$,"\46\32 \13\10"
next b
end
// ScriptEase version of 99 Bottles of beer (Bottles.jsa)
// See http://www.sedesk.com/us/desktop/
// Philipp Winterberg, http://www.winterbergs.de
#include <inout.jsh>
a = " bottle(s) of beer";
c = " on the wall";
d = "Take one down, pass it around,";
for (b = 99 ; b > 0 ; b--)
Clib.printf("%d%s%s,\n%d%s.\n%s\n%d%s%s.\n\n", b, a, c, b, a, d, (b - 1), a, c);
PauseForWin('');
Clib.exit(EXIT_SUCCESS);
The UNIX stream editor. The creator of sed didn't think it's
interesting to edit empty files, so this needs some kind of input, e.g.
echo '' | sed -f 99.sed
1{
s/.*/99 bottles of beer on the wall/
h
: x
p
s/ on.*//
p
s/.*/take :&: down, pass it around/
/one/{
s/:.*:/it/
p
g
s/on\(.*le\)/no mor\1s/
p
s/.*//
q
}
s/:.*:/one/
p
g
y/1234567890/0123456789/
/^.[0-8] /{
s/^.//
x
s/\(.\).*/\1/
G
s/\n//
}
s/^0//
s/^1\( .*le\)s/one\1/
h
p
s/.*//
p
g
b x
}
An online <a href=http://galt.nyu.edu/~bacon/setl-server.html>SETL server</a>
is available where you can run the program without the compiler.
$ SETL version
$ written by Arion Lei (philipl@cs.ust.hk)
beer := {1,2..99};
(until beer={})
print(#beer, " bottles of beer on the wall,");
print(#beer, " bottles of beer. Take one down, pass it around,");
$ take an arbitrary one down
beer less := arb beer;
if beer/={} then
print(#beer, " bottles of beer on the wall.");
end if beer/={};
end until;
print("No more bottles of beer on the wall, no more bottles of beer.");
print("Go to the store and buy some more... 99 bottles of beer");
// SheerPower version of 99 Bottles of beer (Bottles.spsrc)
// See http://nkserver.ttinet.com/sheerpower/
// Philipp Winterberg, http://www.winterbergs.de
clear
declare string a, c
declare integer b
a=" bottle(s) of beer"
c=" on the wall"
for b=99 to 1 step -1
print b; a; c; ","
print b; a; "."
print bold:"Take one down, pass it around,"
print b-1; a; c; "."
print
next b
' ShowText version of 99 Bottles of beer (Bottles.st)
' http://www.programmersheaven.com/zone22/cat254/2672.htm
' Philipp Winterberg, http://www.winterbergs.de
'
INTKEYS CLEAR OFF\RST KEYCLK\NOCHK\CSR OFF\MOUSE OFF
COLOR 15,0\CLS\P+\P@ 25,1
%B=99
WHILE %B>0
PRINT %B,2Z;\PRINT " bottle(s) of beer on the wall,"
PRINT %B,2Z;\PRINT " bottle(s) of beer."
PRINT "Take one down, pass it around,"
%B--\PRINT %B,2Z;\PRINT " bottle(s) of beer on the wall."
SCROLL UP (1,1,25,80)\WAIT 1
WEND
EXITC
Silk is a language for generating web pages on the fly.
<%sub default()%>
<html><title>SilkyBeers</title><body><h1>99 beers on the wall, silk style...</h1><br><br><br>
<%
nBeers = 99
while (nBeers > 0)
?CStr(nBeers) & " bottles of beer on the wall,"
?Cstr(nBeers) & " bottles of beer..."
?"Take one down, pass it around,"
nBeers = nBeers - 1
?CStr(nBeers) & " bottles of beer on the wall.<br>"
wend
%>
</body></html>
<%end sub%>
% SIMPLE version of 99 bottles of beer
% Laurent Vogel, http://lvogel.free.fr
% SIMPLE at http://www.eleves.ens.fr:8080/home/madore/simple.tgz
<def|p|[<if|@1@|0|No more|@1@>] bottle[<if|@1@|1||s>] of beer><def|r|
><def|i|99><def|loop|[<p|<i>>]<def|w| on the wall><w>,<r>[<p|<i>>].
Take one down, pass it around,[<def|i|<-|<i>|1>>]<r>[<p|<i>>]<w>.
[<if|<i>|0||<r>[<loop>]>]><loop>
SIMSCRIPT is a simulation language from CACI and runs on PCs and VAXen.
'' 99 Bottles of Beer using SIMSCRIPT
'' Author: Jeremy Konopka <konopka@cs.uregina.ca>
PREAMBLE
PROCESSES
INCLUDE brewer, drinker
RESOURCES
INCLUDE bottle
DEFINE countem AS A INTEGER VARIABLE
END
MAIN
CREATE EVERY bottle(1)
LET U.bottle(1) = 1
LET countem=100
ACTIVATE A brewer NOW
START SIMULATION
PRINT 1 LINE THUS
No more bottles of beer on the wall.
END
PROCESS brewer
FOR I=1 TO 99
DO
ACTIVATE A drinker NOW
LOOP
END
PROCESS drinker
REQUEST 1 bottle(1)
RELINQUISH 1 bottle(1)
LET countem = countem - 1
IF countem > 1
PRINT 3 LINES WITH countem, countem THUS
** bottles of beer on the wall.
** bottles of beeeeer ...,
Take one down, pass it around,
ELSE
PRINT 3 LINES WITH countem, countem THUS
** bottle of beer on the wall.
** bottle of beeeeer ...,
Take it down, pass it around,
ALWAYS
IF countem > 2
PRINT 2 LINES WITH countem-1 THUS
** bottles of beer on the wall.
ALWAYS
IF countem = 2
PRINT 2 LINES THUS
One more bottle of beer on the wall.
ALWAYS
END
BEGIN
COMMENT
Simula version of 99 beers
Maciej Macowicz (mm@cpe.ipl.fr)
Status: UNTESTED :)
;
INTEGER bottles;
FOR bottles:= 99 STEP -1 UNTIL 1 DO
BEGIN
OutInt(bottles,1);
OutText("bottle(s) of beer on the wall, ");
OutInt(bottles,1);
Outtext("bottle(s) of beer");
OutImage;
Outtext("Take one down, pass it around, ");
OutInt(bottles,1);
OutText("bottle(s) of beer on the wall, ");
END;
OutText("1 bottle of beer on the wall, one bottle of beer.");
Outimage;
OutText("Take one down, pass it around, no more bottles of beer on the wall");
OutImage
END
% ------------------------------------------------------------
% The classic N bottles of beer problem. The Sisal language
% is implicitly parallel and functional. It is not really desigined
% for string processing (scientific numeric stuff is more like it!)
% The following program will run in parallel on Crays, the
% SGI Challenge, the Meiko, etc.... and run just swell on
% your average ordinary PC too. More information on the Sisal
% language project can be found at
%
% http://www.llnl.gov/sisal/SisalHomePage.html
%
% or contact sisal-info@sisal.llnl.gov
%
% Author: Pat Miller (patmiller@llnl.gov)
%
% ------------------------------------------------------------
define main
type string = array[character];
% ------------------------------------------------------------
% OUCH -- have to really start from scratch
% ------------------------------------------------------------
function DigitToChar(d : integer returns character)
character(integer('0')+d)
end function
% ------------------------------------------------------------
% Sisal has no I/O runtime library for strings so we
% can build up the ASCII representation a digit at a time
% The sign handling is there for completeness and is not needed
% to do the BEER problem
% ------------------------------------------------------------
function itoa(n : integer returns string)
array_setl(
let
s := for initial
x := abs(n);
d := array[1: DigitToChar( mod(x,10) )];
while x > 10 repeat
x := old x / 10;
d := array_addl(old d,DigitToChar(mod(x,10)));
returns
value of d
end for
in
if n < 0 then array_addl(s,'-') else s end if
end let
,1)
end function
% ------------------------------------------------------------
% Produce one stanza of the 99 bottles of beer song. Some care
% is taken to keep it grammatical
% ------------------------------------------------------------
function BottlesOfBeer(i : integer returns array[string])
let
s,bottles,preface,n,nextbottles :=
if i = 1 then
"1"," bottle","If that bottle","No more"," bottles"
elseif i = 2 then
itoa(2)," bottles","If one of those bottles",itoa(1)," bottle"
else
itoa(i)," bottles","If one of those bottles",itoa(i-1)," bottles"
end if;
in
array[1:
s || bottles || " of beer on the wall",
s || bottles || " of beer!",
preface || " should happen to fall... ",
n || nextbottles || " of beer on the wall!",
""
]
end let
end function
% ------------------------------------------------------------
% This main loop executes in parallel stuffing the 4 lines
% of each stanza into an array holding the whole song
% ------------------------------------------------------------
function main(n : integer returns array[string])
for i in 0,n-1
howmany := n-i;
stanza := BottlesOfBeer(howmany);
returns value of catenate stanza
end for ||
array[1: "Time to buy more beer"]
end function
/* 99 Bottles of Beer in Slick-C
-- Slick-C is the programming language of
-- Visual Slickedit from Slickedit Inc.
-- More on http://www.slickedit.com
-- programmed by: Siegfried Hirsch, http://www.hhs.de
-- This is a new command for the editor which must
-- be loaded with the "load" command
-- Then it could be used to insert the song into
-- the current editor window with an argument of
-- the number of bottles you would like to drink.
-- CommandLine: bottles 99 <return>
*/
_command bottles(...) {
param = arg(1);
if (param=="" || ! isinteger(param)) {
message('Please give number of bottles');
return(1);
}
for (i = param; i > 0; i--) {
insert_line(i ' Bottles of beer on the wall,' );
insert_line(i ' Bottles of beer.');
insert_line( "Take one down, pass it around,");
if (i - 1 == 0) {
insert_line ("Go to the store and buy some more.");
} else {
insert_line(i-1 " bottles of beer on the wall.");
}
insert_line("");
}
}
# SmallBasic version of 99 Bottles of beer (Bottles.bas)
# See http://smallbasic.sourceforge.net/
# Philipp Winterberg, http://www.winterbergs.de
a=" bottle(s) of beer":c=" on the wall":cls
for b=99 to 1 step -1
?b;a+c+",":?b;a+".":?"Take one down, pass it around,":?b-1;a+c+".":?
next
"Programmer: patrick m. ryan - pryan@access.digex.net
"http://www.access.digex.net/~pryan
99 to: 1 by: -1 do: [ :i |
i print. ' bottles of beer on the wall, ' print.
i print. ' bottles of beer. ' print.
'take one down, pass it around, ' print.
(i-1) print. ' bottles of beer on the wall, ' print.
]
(* SML version of 99 bottles of beer *)
(* written by Norvald - norvald@hsr.no *)
let
val itoa = Makestring.intToStr
fun getabeer 0 = (print "Go to the store and buy some more,\n";
print "99 bottles of beer on the wall.\n")
| getabeer 1 = (print "1 bottle of beer on the wall,\n";
print "1 bottle of beer,\n";
print "Take one down, pass it around,\n";
print "0 bottle of beer on the wall.\n\n";
getabeer (0))
| getabeer x = (print (itoa(x)^" bottles of beer on the wall,\n");
print (itoa(x)^" bottles of beer,\n");
print "Take one down, pass it around,\n";
print (itoa(x-1)^" bottles of beer on the wall.\n\n");
getabeer (x-1))
in
getabeer 99;
end
* 99 BOTTLES OF BEER IN SNOBOL (UNTESTED)
BEER = 99
MOREBEER OUTPUT = BEER ' BOTTLES OF BEER ON THE WALL'
OUTPUT = BEER ' BOTTLES OF BEER'
OUTPUT = 'TAKE ONE DOWN, PASS IT AROUND'
BEER = BEER - 1
OUTPUT = BEER ' BOTTLES OF BEER ON THE WALL'
GT(BEER,0) : S(MOREBEER)
OUTPUT = 'NO MORE BOTTLES OF BEER ON THE WALL'
OUTPUT = 'NO MORE BOTTLES OF BEER'
OUTPUT = 'GO TO THE STORE AND BUY SOME MORE'
OUTPUT = '99 BOTTLES OF BEER'
END
[ sorta version of 99 bottles of beer ]ld
[ Laurent Vogel, http://lvogel.free.fr ]ld
[" bottle"TD1_+=s" of beer"T$ld`ldD]:p[" on the wall"1STD]:w[""`ldD=a]:n
[","=w#=p"."#=p"Take one down, pass it around,"`ldd1_+DD"."=w#=p=n]:a99D
["s"T]:sD=a"."2D=w"No more"=p
* MaxSPITBOL version (SPITBOL implementation on
* the Macintosh from Catspaw, Inc. (Salida, CO).
* NOTE: I have no connection w/them other than being
* a long-time satisfied user of their product
* D.H. <hedges@pilot.njin.net>
p0 = "NO MORE" ; p1 = " BOTTLE" ; p2 = "S" ; p3 = " OF BEER"
p4 = " ON THE WALL" ; p5 = "TAKE ONE DOWN, PASS IT AROUND"
b = 99
p6 = ((NE(b,0) b, p0) p1 (NE(b,1) p2,) p3)
A1 OUTPUT = p6 p4 ; OUTPUT = p6 ; OUTPUT = p5
b = b - 1
p6 = ((NE(b,0) b, p0) p1 (NE(b,1) p2,) p3)
OUTPUT = p6 p4 ; OUTPUT = ; NE(b,0) :S(A1)
END
****************************************************************************
* File: beer.sps
* Source Code: SPSS 5.0
* System/OS: HP/UNIX
* Written By: Keith Chidsey (keithc@gsbc.com)
*
* Write out lyrics to "99 Bottles of Beer on the Wall" to file <beersong>.
****************************************************************************
FILE HANDLE DUMMY/NAME'BEER.SPS'/LRECL=80
FILE HANDLE BEERSONG/NAME'BEERSONG'/LRECL=80
DATA LIST FILE=DUMMY FIXED RECORDS=1/
DUMMY(A1)
STRING LYRIC1,LYRIC2,SPACE(A80)
LOOP BOTTLES=99 TO 1 BY -1
COMPUTE LYRIC1=CONCAT(STRING(BOTTLES,F2),
' BOTTLES OF BEER ON THE WALL, ',
STRING(BOTTLES,F2),
' BOTTLES OF BEER.')
COMPUTE LYRIC2=CONCAT('TAKE ONE DOWN, PASS IT AROUND, ',
STRING(BOTTLES-1,F2),
' BOTTLES OF BEER ON THE WALL.')
WRITE OUTFILE=BEERSONG RECORDS=3/
LYRIC1/LYRIC2/SPACE
END LOOP
EXECUTE
FINISH
remark 99 bottles of beer with Oracle SQL*Plus
remark R.vandePol@voeding.tno.nl < Rob van de Pol>
remark
remark assuming that YourTable contains at least 99 rows ;-)
remark
remark RowNum is an Oracle psuedo column indicating the sequence the rows
remark were selected.
SELECT TO_CHAR(100-rownum)||' bottles of beer on the wall, ' ||
TO_CHAR(100-rownum)||' bottles of beer,' ,
'take one down and pass it around, ' ,
DECODE ( TO_CHAR(99-rownum) , '0' , 'No more' , TO_CHAR(99-rownum) )||
' bottles of beer,'
FROM YourTable
WHERE rownum < 100
# SR version of 99 bottles of beer
# by David Larsson
# mailto:f92dala@dd.chalmers.se http://www.dd.chalmers.se/~f92dala
#
# This version demonstrates some of SR's concurrent aspects, simulating
# the (common?) situation where 99 people drink one bottle of beer each
# simultaneously, while singing exactly one verse of the song.
#
resource main()
op sing_it(int; string[120])
# Create 99 processes (or, rather, threads)
# for the verses in the song
process swing_it(bottle := 1 to 99)
var bottle1_str, bottle2_str : string[15];
if bottle > 2 ->
bottle1_str := string(bottle) || " bottles";
bottle2_str := string(bottle-1) || " bottles";
[] bottle = 2 ->
bottle1_str := "2 bottles";
bottle2_str := "1 bottle";
[] else ->
bottle1_str := "1 bottle";
bottle2_str := "No more bottles";
fi
# Send the verse back to the main thread
send sing_it(bottle,
bottle1_str || " of beer on the wall, "
|| bottle1_str || " of beer...\n"
|| "Take one down and pass it around\n"
|| bottle2_str || " of beer on the wall\n");
end swing_it
# Make sure the verses get printed in the right order
fa expected := 99 downto 1 ->
in sing_it(bottle, verse) st bottle = expected ->
write(verse);
ni
af
# I guess the bartender sings this one
write("Go to the store, buy some more!");
write("99 bottles of beer on the wall");
end main
sub Main
' Ninety-nine bottles of beer in StarBasic
' for usage in StarOffice/OpenOffice
'
' Daniel Hanke
' http://www2.hs-harz.de/~359/
' June 7, 2002
'
oDesktop = createUnoService("com.sun.star.frame.Desktop")
sUrl = "staroffice.factory:swriter"
oDoc = oDesktop.LoadComponentFromURL(sURL,"_blank",0,mNoArgs)
oText = oDoc.Text
oCursor = oText.createTextCursor()
dim bottles
dim stext
oCursor.CharHeight = 18
p(oText,"99 bottles of beer")
oCursor.CharHeight = 12
for bottles = 99 to 1 step -1
dim sbottle
sbottle = cstr(bottles)+iif(bottles=1," bottle"," bottles")
l(oText,sbottle+" of beer on the wall")
l(oText,sbottle+" of beer ...")
l(oText,"Take one down, pass it around,")
l(oText,iif(bottles=1,"No more bottles",cstr(bottles-1)+_
iif(bottles-1=1," bottle"," bottles"))+" of beer on the wall")
p(oText,"")
next bottles
p(oText,"Time 2 go home")
end sub
sub l(otext as object,stext as string)
otext.insertString(oCursor,stext,FALSE)
otext.insertControlCharacter(oCursor,_
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,FALSE)
end sub
sub p(otext as object,stext as string)
otext.insertString(oCursor,stext,FALSE)
otext.insertControlCharacter(oCursor,_
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,FALSE)
end sub
; StarLogo version of 99 bottles of beer
; by Uwe Kaessner (ukblue@friendsinside.de)
; StarLogo (http://www.media.mit.edu/starlogo) is based on Logo
to 99bottles
let [:i 99]
repeat 99 [
print se :i [bottle(s) of beer on the wall]
print se :i [bottle(s) of beer]
print [take one down, pass it around]
print se (:i - 1) [bottle(s) of beer on the wall]
print ""
set :i (:i - 1)
]
end
/* Stata-Version of 99 bottles of beer */
/* Stata is a program for doing statistics */
/* By Michael Hoefler */
#delimit;
for num 1/99:
disp "Bottle(s) of beer on the wall, " X \ disp " bottle(s) of beer"
\
disp "Take one down and pass it around,"
\
disp X-1 "bottle(s) of beer on the wall" ;
SUB main()
REM "99 bottles of beer", Superbase SBL version
REM written by Mark Pilgrim, f8dy@netaxs.com
REM [ If my boss is reading this, I'd just like to reassure
REM him that I wrote this on my own time. -MP ]
DIM i%%,beer$,bottle$
OPEN WINDOW "99 bottles of beer"
bottle$ = " bottles "
beer$ = "99"
FOR i%% = 99 TO 1 STEP - 1
? beer$ + bottle$ + "of beer on the wall,"
? beer$ + bottle$ + "of beer,"
? "Take " + IF (i%% > 1,"one","it") + " down, pass it around,"
IF i%% > 1 THEN
beer$ = LTRIM$ ( TRIM$ ( STR$ (i%% - 1)))
IF i%% = 2 THEN bottle$ = " bottle "
? beer$ + bottle$ + "of beer on the wall."
?
ELSE
? "No more bottles of beer on the wall."
END IF
NEXT
END SUB
on mouseup
put 99 into numBeerz
put "s it" into modifier
repeat with x = numBeerz down to 1
put "one" into whichone
put "s" into modifier
put "s" into otherModifier
put x - 1 into nextCount
if x is 2 then put "" into otherModifier
if x is 1 then
put "it" into whichone
put "" into modifier
put "s" into otherModifier
put "no more" into nextCount
end if
put x & " bottle" & modifier& " of beer on the wall, " & x & " bottle" &
modifier & " of beer..." after y
put " Take " & whichOne & " down, pass it around, " & nextCount & "
bottle" & otherModifier & " of beer on the wall. " & cr after y
end repeat
put "No more bottles of beer on the wall, ya bastards drank them all! So
off to the store to buy some more, let's put 99 bottles of beer on the
wall!" & cr after y
put y into card field 1
-- say cd fld 1 -- uncomment this line to hear it sing.
end mouseup
See http://www.cca-int.com/prodinfo/s1032.html
Procedure CountTheBottles Trigger Open Enabled Secure
var bottles integer
for (bottles from 99 to 1 step -1) do
if bottles eq 1 then
print bottles (" bottle of beer on the wall")
print bottles (" bottle of beer...");
else
print bottles (" bottles of beer on the wall")
print bottles (" bottles of beer...");
end_if
print ("Take one down and pass it around...")
end_for
print ("No Bottles of beer on the wall")
End_Procedure
Call CountTheBottles