M-Speak is a word-processing macro language created in the late 1970's for the
Spellbinder word processor.
;-) Spellbinder Macro to print "99 Bottles of Beer on the Wall" (-;
; by Andy Goldberg
;
:%A="s" ;set variable for plural
:%1=99 ;initialize counter
:%2=%1-1 ;decrement at top of loop
s//%1 bottle%A of beer on the wall</ ;lyric
s//%1 bottle%A of beer</<
s//Take one down and pass it around</
:on %2-1 /+4 / /+1 ;check for last stanza
:%A="" ;if last stanza clear plural
s//%2 bottle%A of beer on the wall.<</ ;last line and blank line
:%1=%1-1 ;check for end
:on -1 /-9 ;if not end then loop
s//No more bottles of beer on the wall.</ ;ending line
/t/p/wo/song.txt/t/gd ;print, save and end (optional)
A Unix macro language.
# by Ozan S. Yigit" (oz@sni.ca)
#
define(BOTTLES,`ifelse($1, 0, no more bottles,
$1, 1, one bottle, $1 bottles) of beer') dnl
define(BEER,`ifelse(eval($1 > 0), 1,
`BOTTLES($1) on the wall, BOTTLES($1)
take one down, pass it around
BOTTLES(eval($1 - 1)) on the wall.
BEER(eval($1 - 1))')') dnl
BEER(10)
!rem 99 bottles of beer in the M5 macro language
!rem programmer Ron Franke-Polz - ronaldFP@aol.com
!rem
!rem define a macro which contains the song
!rem
!macro song
[v $1] [if [eq $1 1] "bottle" "bottles"] of beer on the wall,
[v $1] [if [eq $1 1] "bottle" "bottles"] of beer,
take one down and pass it around,
[if [eq [- $1 1] 1] "No more" [- $1 1]] [if [eq [- $1 1] 1] "bottle" "bottles"] of beer on the wall.
!endm
!rem
!rem sing the song 99 times
!rem
!eval [set count 99]
!while count
!song (count)
!eval [-- count]
!endwhile
; Here is the Macintosh WordPerfect macro language version.
Assign (Var01;99)
Repeat
Type Var (Var01)
Type ( bottles of beer on the wall. )
Type Var (Var01)
Type ( bottles of beer. )
Type (Take one down, pass it around. )
Assign (Var01;Var01-1)
Type Var (Var01)
Type ( bottles of beer on the wall.)
Hard Return
Until (Var01=0)
\ MacroX version of 99 Bottles of beer (Bottles.mcx)
\ See http://www.millsoft.de/?f=macrox
\ Philipp Winterberg, http://www.winterbergs.de
run=notepad,1
%b%=99
loop=Bottles=99
stop
Bottles:
text=%b% bottle(s) of beer on the wall,{enter}
text=%b% bottle(s) of beer.{enter}
text=Take one down, pass it around,{enter}
Calc={%b%-1},b
text=%b% bottle(s) of beer on the wall.{enter}{enter}
loopend
A procedural language written in Forth. Originally ran on
Z80's under CP/M and later available for IBM-PCs and Sun 3s.
; MAGIC/L version of the beer bottle song
; (c) 1996 Eric Korpela (korpela@ssl.berkeley.edu)
; WARNING! All the spaces are necessary!
;
; Add the help entry....
.subject bottles
Usage: bottles ( number )
.
; and here's the procedure
define bottles
integer number
local integer current
;
current := number
while ( current > 1 )
print current , " bottles of beer on the wall."
print current , " bottles of beer."
print "You take one down and pass it around."
current := current - 1
print current , " bottles of beer on the wall."
print
repeat
;
print 1 , " bottle of beer on the wall."
print 1 , " bottle of beer."
print "You take one down and pass it around."
print "No bottles of beer on the wall.
end
Magma is a computer algebra system from Australia.
verse := function(n)
bottles := function(n)
return n eq 1 select "1 bottle"
else IntegerToString(n) cat " bottles";
end function;
return current cat " of beer on the wall,\n" cat
current cat " of beer;\n" cat
"Take one down, pass it around,\n" cat
bottles(n - 1) cat " of beer on the wall.\n\n"
where current is bottles(n);
end function;
song := procedure()
print &cat [verse(n) : n in [99 .. 1 by -1]] cat
"Go to the store and get some more.";
end procedure;
make is technically a tool for building applications, but it's
amazing what a pre-processor and recursion can do for you.
#
#
# quick effort at 99 bottles program using gnu make
#
# the file must be called makefile.bottles
#
# Author: Andrew Dunstan (andrew.dunstan@its.maynick.com.au)
#
default:
$(MAKE) -f makefile.bottles BOTTLES=99 bottles
.SILENT:
bottles:
echo $(BOTTLES) bottles of beer on the wall
echo $(BOTTLES) of beer
echo Take one down and pass it around
ifeq ($(BOTTLES),0)
echo No bottles of beer on the wall
else
echo `expr $(BOTTLES) - 1` bottles of beer on the wall
echo
$(MAKE) -f makefile.bottles BOTTLES=`expr $(BOTTLES) - 1` bottles
endif
#
# Vanilla (non-graphical) version of 99 Bottles as sung
# reluctantly by Maple V3, and only under the agreement that it
# will be called on to perform the song properly, in color, and with
# appropriate animation... someday
#
# Authors: Hill and Burstall (handb@ionet.net)
#
lyrics:=(` Bottle`,` of beer on the wall! ` ,` of beer! Take`,
` down, pass it around...`):
for i from 99 by -1 to 3 do
print(cat ( i ,lyrics[1],`s`,lyrics[2]),
cat(i, lyrics[1],`s`,lyrics[3],` one`,lyrics[4]),
cat(i-1,lyrics[1],`s`,lyrics[2]))
od;
print(cat ( i ,lyrics[1],`s`,lyrics[2]), cat(i, lyrics[1],`s`,lyrics[3],` one`,
lyrics[4]), cat(i-1,lyrics[1],lyrics[2]));
print(cat ( `1` ,lyrics[1],lyrics[2]), cat(`1`, lyrics[1],lyrics[3],` it`,
lyrics[4]), cat(`0`,lyrics[1],`s`,lyrics[2]));
BEER RCDUMMYFD S U S T R
BEER RFSUBFILE SM4SUBF1
BEER ERDATE
BEER AA
BEER AA <a href http://www.cstp.umkc.edu/users/mpasser>Michael Passer</a>
BEER AA
BEER AA This program requires one dummy record of input
BEER AA (the M4OLD DD) to trigger execution. Output is
BEER AA sent to the first subfile (M4SUBF1 DD).
BEER AA
BEER TFBOTTLESZ 3Z 100
BEER AA ----+----1----+-
BEER TFBOB 15C BOTTLES OF BEER
BEER TFOTW 11C ON THE WALL
BEER TFTOD 13C TAKE ONE DOWN
BEER TFPIA 14C PASS IT AROUND
BEER TFCOMMA 1C ,
BEER TFPERIOD 1C .
BEER TFBLANK 1C
BEER PR GO SUB SING
SING ERDATE S 100
SING PR TBOTTLESZEQD0
SING PR GS RETURN
SING PR GO SUB CHORUS
SING PR R TMINUS1Z TBOTTLESZ
SING PR GO REQUEST SING
CHORUS ERDATE S
CHORUS TFMINUS1Z 3Z
CHORUS TFBOTTLES 3C
CHORUS TFMINUS1 2C
CHORUS PR TBOTTLESZ- D1 TMINUS1Z
CHORUS PR R TBOTTLESZ TBOTTLES
CHORUS PR R TMINUS1Z TMINUS1
CHORUS E1 NR SUBFILE V
CHORUS R1 TBOTTLES
CHORUS R1 TBLANK
CHORUS R1 TBOB
CHORUS R1 TBLANK
CHORUS R1 TOTW
CHORUS R1 TCOMMA
CHORUS E2 NR SUBFILE V
CHORUS R2 TBOTTLES
CHORUS R2 TBLANK
CHORUS R2 TBOB
CHORUS R2 TCOMMA
CHORUS E3 NR SUBFILE V
CHORUS R3 TTOD
CHORUS R3 TCOMMA
CHORUS R3 TBLANK
CHORUS R3 TPIA
CHORUS R3 TCOMMA
CHORUS E4 NR SUBFILE V
CHORUS R4 TMINUS1
CHORUS R4 TBLANK
CHORUS R4 TBOB
CHORUS R4 TBLANK
CHORUS R4 TOTW
CHORUS R4 TPERIOD
CHORUS E5 NR SUBFILE V
CHORUS R5 TBLANK
<a href=http://mathserv.math.sfu.ca/Software/MmaIntro.html>Mathematica</a> is a computer algebra system.
(* Mathematica version of 99 Bottles of Beer *)
(* Bill Dall *)
Do[If[i>1,
Print[i, " more bottles of beer on the wall. ",i,
" more bottles of beer."];
Print["Take one down, pass it around."],
(* else *)
Print["1 more bottle of beer on the wall. 1 more bottle of beer."];
Print["Take one down, pass it around."];
Print["No more bottles of beer on the wall."]
], (* If *)
{i,99,1,-1}]
% MATLAB *vectorized* version of "99 bottles of beer"
% Rich Stein (rich@cs.umbc.edu)
bottles = [98:-1:3]; % bottles 98 to 3 (99, 2 & 1 are treated as special case)
lines = 3; % need the number of bottles at the beginning of 3 lines
num_array = ones(lines,1) * bottles; % bottles is a (1x96) array
format_plural1 = '%d bottles of beer on the wall,\n%d bottles of beer,\n';
format_plural2 = 'Take one down, pass it around,\n%d bottles of beer on the wall.\n\n';
format_sing1 = '%d bottle of beer on the wall,\n%d bottle of beer,\n';
format_sing2 = 'Take one down, pass it around,\n%d bottle of beer on the wall.\n\n';
format_none2 = 'Take it down, pass it around,\nNo bottles of beer on the wall.\n';
% bottles 99, 2 & 1 are treated as special cases
fprintf([format_plural1 format_plural2], 99,99,num_array,2)
fprintf([format_plural1 format_sing2], 2,2,1)
fprintf([format_sing1 format_none2], 1,1)
a href=http://www.mathworks.com>Click</a> for more information.
% MATLAB verion of 99 Bottles of beer
% by Bill Becker
function beer(n);
if nargin<1, n=99; end
for i=n:-1:1,
disp([int2str(i) ' Bottles of beer on the wall,'])
disp([int2str(i) ' Bottles of beer,'])
disp('Take one down and pass it around,')
if i>1, disp([int2str(i-1) ' Bottles of beer on the wall.']),end
end
disp('No more bottles of beer on the wall!')
--
-- Maxscript is the scripting language for 3DS Max,
-- a 3D computer animation package
--
-- 23 dec 02 R. J. Wolfe
for j = 99 to 1 by -1 do (
bottle = "bottle"
if j > 1 then (
bottle = bottle + "s"
)
format "% % of beer on the wall, \n" j bottle
format "% % of beer, \n" j bottle
format "Take one down, pass it around, \n"
if (j-1) == 1 then
bottle = "bottle"
else
bottle = "bottles"
format "% % of beer on the wall.\n\n" (j-1) bottle
)
Mel, or "Maya Embedded Language" is an interpreted scripting language used
for the 3d animation software Maya.
// This version is perhaps cleaner to read
for( $i = 99; $i > 0; $i++){
print( $i+" bottles of beer on the wall,\n"
+$i+" bottles of beer.\nTake one down, pass it around,\n"
+($i-1)+ " bottles of beer on the wall!\n"));
}
This program is written in MEDITECH Magic. This is NOT the same Magic
as you have listed but was developed by Medical Information Technology
in 1980 and is still in use.
As MEDITECH is not only a large software company but on of the oldest,
independent software companies in the world (est. 1969), I hope you
consider this a valid language.
As you can see, it is an extremely concise language and lots of fun to use.
BEER,
100^b,T("")^#,DO{b-1^b'<0 NN(b,"bottle"_IF{b=1 " ";"s "}_"of beer on the wall")^#,
N(b,"bottle"_IF{b=1 " ";"s "}_"of beer!")^#,
N("You take one down, pass it around,")^#,
N(b,"bottle"_IF{b=1 " ";"s "}_"of beer on the wall!")^#},
END;
A purely declarative logic programming language.
<a href="http://www.cs.mu.oz.au/~zs/mercury.html">Click</a> for more information.
% file: beer.m
% author: Fergus Henderson <fjh@cs.mu.oz.au>
% date: Thursday 9th November 1995
:- module beer.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module int.
main --> beer(99).
:- pred beer(int::in, io__state::di, io__state::uo) is det.
beer(N) -->
( { N = 0 } ->
io__write_string("Go to the store and buy some more!")
;
bottles(N),
io__write_string(" on the wall,\n"),
bottles(N),
io__write_string(".\n"),
io__write_string("Take one down, pass it around,\n"),
{ N1 is N - 1 },
bottles(N1),
io__write_string(" on the wall.\n\n"),
beer(N1)
).
:- pred bottles(int::in, io__state::di, io__state::uo) is det.
bottles(N) -->
( { N = 0 } ->
io__write_string("No more bottles of beer")
; { N = 1 } ->
io__write_string("1 bottle of beer")
;
io__write_int(N),
io__write_string(" bottles of beer")
).
<html>
<head> <title> 99 Bottles of Beer: The Compleat Lyrics </title> </head>
<body>
;;;
;;; The actual source code to The Compleat Lyrics.
<defsubst plural whitespace=delete>
<if <not <eq %0 1>> s>
</defsubst>
<set-var beers=99>
<while <gt beers 0>>
<get-var beers> bottle<plural beers> of beer on the wall, <br>
<get-var beers> bottle<plural beers> of beer, <br>
You take one down, pass it around, <br>
<decrement beers>
<get-var beers> bottle<plural beers> of beer on the wall.
<p>
</while>
No more bottles of beer on the wall, <br>
No more bottles of beer, <br>
Go to the store, and buy some more, <br>
<form method=GET action="<get-var mhtml::current-url>">
<input type="submit" name="button" value="99 Bottles of beer on the wall">
</form>
</body>
</html>
# This is 99 bottles of beer on the wall, in metacard.
# MetaCard is a RAD tool that is HyperCard on steroids for multiple
# platforms, available at www.metacard.com
on mouseup
repeat with i = 99 down to 2
answer i & "bottles of beer on the wall," & return & \
i & "bottles of beer..." & return & \
"Take one down, pass it around," & return & \
(i-1) & "bottles of beer on the wall."
end repeat
--
answer "1 bottle of beer on the wall," & return & \
"1 bottle of beer..." & return & \
"Take one down, pass it around, no bottles of beer on the wall."
--
answer "NO bottles of beer on the wall," & return & \
"NO bottlse of beer..." & return & \
"There's no beer left, that's the end."
end mouseUp
--
:)
Richard MacLemale
Network Administrator
J. W. Mitchell High School
For more information on MetaPost see
<a href=http://cm.bell-labs.com/who/hobby/MetaPost.html>http://cm.bell-labs.com/who/hobby/MetaPost.html</a>
% MetaFont/MetaPost version of ``99 bottles'' by Tomasz J. Cholewo
% For more information see http://cm.bell-labs.com/who/hobby/MetaPost.html
for i:=99 downto 1:
message decimal i & " bottle" if i>1: & "s" fi & " of beer on the wall,";
message decimal i & " bottle" if i>1: & "s" fi & " of beer.";
message "Take one down, pass it around.";
endfor;
message "No more bottles of beer on the wall.";
end
PROGRAM BEER;
BEGIN
I := 100;
S := "s";
Bottle := " bottle";
Punkt := ".";
Komma := ",";
Line1 := " ";
Line2 := " ";
Line1a := " of beer on the wall";
Line2a := " of beeeeer . . . ,";
Line3 := "Take one down, pass it around,";
Line4 := "No more bottles of beer on the wall.";
Line5 := "Time to buy more beer!";
LOOP
<
I := I-1;
If I LT 10 Then
<
Line1 := Bottle + Line1a;
Line2 := Bottle + Line2a;
>
ELSE
<
Line1 := Bottle + s + Line1a;
Line2 := Bottle + s + Line2a;
>;
Writeln(I,TRIM(Line1),Komma);
Writeln(I,TRIM(Line2));
Writeln(Line3);
If I EQ 1 Then
<
Writeln(Line4);
Writeln(" ");
Writeln(Line5);
EXIT;
>
ELSE
<
If I EQ 10 Then
<
Line1 := Bottle + Line1a;
>;
Writeln(I-1,TRIM(Line1),Punkt);
Writeln(" ");
>;
>; /* End LOOP */
END;
|| 99 bottles of beer in Miranda - the hideous functional programming lingo
|| by Tim Walls, tjw1@doc.ic.ac.uk, http://www-students.doc.ic.ac.uk/~tjw1/
||
|| Call with 'bottlesofbeer 99'.
bottlesofbeer :: num -> [char]
bottlesofbeer n = "\nNo more bottles of beer on the wall, \n"
++ "no more bottles of beer.\n" , if n = 0
= "\nOne more bottle of beer on the wall, one bottle of beer,\n"
++ "Take one down and pass it around"
++ (bottlesofbeer (n-1)) , if n = 1
= "\n" ++ shownum(n) ++ " bottles of beer on the wall,"
++ shownum(n)
++ " bottles of beer,\nTake one down and pass it around"
++ (bottlesofbeer (n-1)) , otherwise
99 Bottles of Beer in mIRC script:
From Ryan Kusnery http://members.tripod.com/rkusnery/index.html
/beer99 {
/set %bottles 99
/set %beercolor 4
:morebeer
/echo %beercolor %bottles bottles of beer on the wall.
/echo %beercolor %bottles bottles of beer...
/echo %beercolor Take one down, pass it around,
/dec %bottles
if (%bottles == 1) goto onebeer
/echo %beercolor %bottles bottles of beer on the wall.
/echo %beercolor $chr(160)
goto morebeer
:onebeer
/echo %beercolor One bottle of beer on the wall.
/echo %beercolor $chr(160)
/echo %beercolor One bottle of beer on the wall.
/echo %beercolor One bottle of beer...
/echo %beercolor Take it down, pass it around,
/echo %beercolor No more bottles of beer on the wall.
unset %bottles
unset %beercolor
}
MCSKIP - WITH - NL
-- (The line above defines comment syntax: it must preceed -- comments.)
--
-- 99 Bottles of beer in ML/I by Parzival Herzog.
-- ML/I is P.J. Brown's famous general purpose macro processor
-- designed in 1967.
-- See http://members.shaw.ca/parz/ML1.html
--
-- Incantations:
MCSKIP MT, {}
MCSKIP T, ""
MCINS ?.
--
-- Main macro: "99 bottles of beer"
MCDEF "99 WITHS bottles WITHS of WITHS beer" AS {MCSET T1=99
?L1.Say ?T1. bottles of beer on the wall, Say ?T1. bottles of beer,
take one down pass it around,
Say ?T1-1. bottles of beer.
MCSET T1=T1-1
MCGO L1 IF T1 GE 1
}
--
-- Pluralizing macro: "Say n bottles of beer"
MCDEF "Say bottles WITHS of WITHS beer" AS --
{MCGO L??A1.+10. IF 2 GR ?A1.
?A1." bottles"MCGO L1
?L10."No more bottles"MCGO L1
?L11."One more bottle"?L1." of beer"}
--
-- "99 bottles of beer" is replaced by the specified song:
99 bottles of beer
(* ML version of 99 bottles of beer *)
(* - Using pattern of functions parameters *)
(* and Recursion(like other functional programming langauges) *)
(* Written by Jong-Won Choi(jwchoi@gsen.goldstar.co.kr) *)
(* Nov 13, 95 *)
fun NinetyNineBottlesOfBeer(0) =
print("\n No more bottles of beer on the wall\n")
| NinetyNineBottlesOfBeer(1) =
(print("\n 1 bottle of beer on the wall, 1 bottle of beer.");
print("\n Take one down and pass it around.");
NinetyNineBottlesOfBeer(0))
| NinetyNineBottlesOfBeer(NumberOfBottles:int) =
(print("\n "); print(NumberOfBottles);
print(" bottle of beer on the wall, ");
print(NumberOfBottles);
print(" bottle of beer.");
print("\n Take one down and pass it around.");
NinetyNineBottlesOfBeer(NumberOfBottles - 1));
$ Programmed in a happy hour before our informatics exam about MMIX
$ by Hannes Hannak (hanhan@gmx.de) and Mathias Poths (poths@uni.de)
$ [comments by Thomas Rösner (roesner@informatik.uni-tuebingen.de)]
$ website at http://www.poths.com/99bottles.php *15th of July 2002*
$ Here is another line with exactly the same length as those above.
$ Our fluffy little strings have to live in the boring data segment
LOC Data_Segment+#100
GREG @
A BYTE " Bottle(s) of beer on the wall,",#a,0
LOC (@+3)&-4
B BYTE " Bottle(s) of beer.",#a,0
LOC (@+3)&-4
C BYTE "Take one down, pass it around,",#a,0
LOC (@+3)&-4
D BYTE " Bottle(s) of beer on the wall.",#a,#a,0
$ Our code - naturally - wants to sit in a truly executive position
LOC #100
$ First we give our poor "I'm just a number"-registers a fancy name
i0 IS $0 Our bottles!
i1 IS $1 Invariant: there are i1*10+i0 bottles of beer on the
wall
a IS $2 Here the pointers to the strings above will reside
b IS $3
c IS $4
d IS $5
offset IS $6 This helps us printing 5 instead of 05
t IS $255 A sad global register holding nothing but tmp data
$ Second these registers get some very sophisticated initial values
Main SET i0,9 99 bottles of beer
SET i1,9
LDA a,A Load address of strings
LDA b,B (kindly sponsored by GREG@)
LDA c,C
LDA d,D
$ Welcome to the MAIN LOOP! Ye all who enter here, abandon all beer
1H ADDU t,i0,i1
BZ t,0F i0+i1==0? No beer left. Go away.
$ The next part is about the dark side of MMIX: string manipulation
ADDU t,i1,'0' Convert i1 to a ASCII-digit and
STBU t,a write it in our strings.
STBU t,b
ADDU t,i0,'0' The same for i0,
STBU t,a,1 but one byte behind.
STBU t,b,1
SUBU i0,i0,1 decrement i0 and
BNN i0,2F watch for overflow
SET i0,9 and handle it.
SUBU i1,i1,1
2H ADDU t,i1,'0' again, write our new digits
STBU t,d
ADDU t,i0,'0' both of them
STBU t,d,1
$ While manipulation can be fun better remember to watch the result
ADDU t,a,offset we shall never print a leading zero
TRAP 0,Fputs,StdOut bring forth the strings so I can sing them!
ADDU t,b,offset
TRAP 0,Fputs,StdOut
SET t,c <-- this is a boring constant string
TRAP 0,Fputs,StdOut we print it anyway
ZSZ offset,i1,1 Hm, time to think about a new offset
ADDU t,d,offset so our last line will have a correct one
TRAP 0,Fputs,StdOut when printed
$ "Premature optimization is the root of all evil." Donald E. Knuth
JMP 1B sing(verse++);
0H TRAP 0,Halt,0 Sorry, we're closed.
*Model 204 (or M204 as it's commonly called) is a proprietary
*database and language of Computer Corporation of America.
*It was first developed over 30 years ago by the NSA.
*Some claim that it's the fastest IBM Mainframe database.
*It is good for databases with large record counts.
*The Department of Social Security of Australian employs
*hundreds of M204 programmers.
*Add-on packages permit SQL and Web access.
*
* Written by Kevin Giles, NCI Information Systems Inc.
* e-mail: KGILES@USGS.GOV
*
* 100 bottles of beer / take one / action
*
*LOWER
BEGIN
DECLARE %S IS STRING LEN 1 COMMON
FOR %BOTTLE FROM 100 TO 0 BY -1
CALL CHECKPLURAL(%BOTTLE)
PRINT %BOTTLE AND 'bottle' WITH %S AND 'of beer on the wall.'
PRINT %BOTTLE AND 'bottle' WITH %S AND 'of beer.'
PRINT 'Take one down, pass it around.'
CALL CHECKPLURAL(%BOTTLE-1)
IF %BOTTLE-1 = +0 THEN PRINT 'No bottles of beer on the wall.'
SKIP 1 LINE
PRINT 'No bottles of beer on the wall.'
PRINT 'No bottles of beer.'
PRINT 'Go to the store, buy some more.'
%BOTTLE = 101
CALL CHECKPLURAL(%BOTTLE-1)
END IF
PRINT $UNBLANK(%BOTTLE-1) AND 'bottle' WITH %S AND -
'of beer on the wall.'
SKIP 1 LINE
END FOR
SUBROUTINE CHECKPLURAL (%PASSVAL STRING DP 0 INPUT)
IF %PASSVAL NE +1 THEN %S = 's'
ELSE %S = ''
END IF
END SUBROUTINE
END
(* Modula-2 version of 99 Bottles of Beer *)
(* Tested on a VAX 7700 running OpenVMS *)
(* Programmer: Jeremy Rule rulej@tempest.adsnet.net *)
MODULE BottlesOfBeer;
FROM InOut IMPORT WriteCard, WriteString, WriteLn;
CONST
BOTTLES = 99;
VAR
counter : CARDINAL;
BEGIN
counter := BOTTLES;
REPEAT
WriteCard( counter,2 );
WriteString(" bottles of beer on the wall, ");
WriteCard( counter,2 );
WriteString(" bottles of beer."); WriteLn;
WriteString(" Take one down, and pass it around, ");
DEC( counter );
WriteCard( counter,2 );
WriteString(" bottles of beer on the wall."); WriteLn;
UNTIL ( counter = 1 );
WriteString("1 bottle of beer on the wall, 1 bottle of beer"); WriteLn;
WriteString("Take it down and pass it around, ");
WriteString("No more bottles of beer on the wall."); WriteLn;
END BottlesOfBeer.
MODULE BottlesOfBeer EXPORTS Main;
FROM IO IMPORT Put ;
FROM Fmt IMPORT Int ;
VAR bottles := 99 ;
BEGIN
WHILE (bottles > 0) DO
Put(Int(bottles) & " bottle(s) of beer on the wall,\n") ;
Put(Int(bottles) & " bottle(s) of beer. \n") ;
Put("Take one down, and pass it around,\n");
DEC(bottles);
Put(Int(bottles) & " bottle(s) of beer on the wall.\n");
END ;
END BottlesOfBeer.
@args #230:"@99" none none none
@chmod #230:@99 rxd
@program #230:@99
"Programmed by Malcolm Gin-Hopwood y Silva (perigee@dgsys.com)";
"Runs on LambdaMOO core 1.7.9 and 1.8.0";
"This one spares any standers by the terror of 99 bottles of beer on the wall,
and does numbers to english passing as well. Woo woo.";
count = 99;
while (count > 0)
$command_utils:suspend_if_needed(0);
this:_round_of_beer(count);
count = count - 1;
endwhile
player:tell("Time to buy more beer.");
.
@args #230:"_round_of_beer" this none this
@program #230:_round_of_beer
beer = args[1];
player:tell(($string_utils:capitalize($string_utils:english_number(beer)) +
((beer == 1) ? " bottle " | " bottles ")) + "of beer on the wall.");
player:tell(($string_utils:capitalize($string_utils:english_number(beer)) +
((beer == 1) ? " bottle " | " bottles ")) + "of beer...");
player:tell("Take one down and pass it around.");
player:tell(($string_utils:capitalize($string_utils:english_number(beer - 1))
+ (((beer - 1) == 1) ? " bottle " | " bottles ")) + "of beer on the wall.");
player:tell();
.
<a href=http://www.netaxs.com/~jayfar/mops.html>Mops</a> is a
Forth-based OOP freeware package for developing Macintosh applications.
\ Mops Beer (object paradigm)
\ by Bruce Bennett
:class BEER super{ object }
record{
var n
}
private
:m lastBottle:
cr ." 1 last bottle of beer on the wall," cr
." Only 1 bottle of beer." cr
." Take it down, pass it around --" cr
." No more bottles of beer!" cr
;m
public
:m bottlesOf: { n -- }
1 n DO
i 1 = IF lastBottle: self LEAVE THEN cr
i . ." bottles of beer on the wall," cr
i . ." bottles of beer." cr
." Take one down, pass it around," cr
i 2 = IF i 1 - . ." last bottle of beer." ELSE
i 1 - . ." bottles of beer on the wall." THEN cr
-1 +LOOP
;m
;class
beer beer!
99 bottlesOf: beer!
Mouse language from Tom Hunt
X 100 =
(
X. ! " Bottle(s) of beer on the wall, "
X. ! " bottle(s) of beer!"
"Take one down and pass it around,!"
X 1 X . - = 'X--
X. ! " bottle(s) of beer on the wall.!"
' 0 X . - ^
X . ^
)
$$
% http://www.mozart-oz.org/
% By Kari Pahula
functor
import
Application at 'x-oz://system/Application'
Open at 'x-oz://system/Open'
define
Stdout = {New Open.file init(name:stdout)}
proc {Bottles N} S in
if N \= 1 then S="s" else S=nil end
{Stdout write(vs:N#" bottle"#S#" of beer on the wall,\n")}
{Stdout write(vs:N#" bottle"#S#" of beer.\n")}
end
proc {Drink B}
case B of X|Xr then
{Bottles X}
{Stdout write(vs:"Take one down, pass it around,\n\n")}
{Drink Xr}
[] nil then
{Bottles "No more"}
{Stdout write(vs:"Go buy more beer!\n")}
end
end
fun {Shelve N}
if N > 0 then N|{Shelve N-1} else nil end
end
{Drink {Shelve 99}}
{Application.exit 0}
end
;;; mp4h version of 99 bottles of beer
;;; Laurent Vogel, http://lvogel.free.fr
;;; (m4ph, see http://www.engelschall.com/sw/mp4h/)
;;;
<define-tag p whitespace=delete>
<ifeq %0 0 "No" %0> bottle<ifeq <gt %0 1> true "s"> of beer%1
</define-tag><define-tag q><p %0 " on the wall,">
<p %0 ".">
Take one down, pass it around,
<p <add %0 -1> " on the wall.">
</define-tag><set-var i=99 />;;;
<while <gt <get-var i /> 0 />><q <get-var i />><decrement i /></while>
MPI is built in like MUF (which you also have on your site) into an
online game which can be downloaded from www.belfry.com/fuzzball
{null:{for:i,99,1,-1,{with:t,{&i},{tell:{&t} bottles of beer on the wall}
{tell:{&t} bottles of beer}{tell:Take one down and pass it around}{dec:t,1}
{tell:{&t} bottles of beer on the wall.}}}}
; MPTMON (Multi Processor Test Monitor) is a debugging
; tool for telephonic exchanges from Alcatel.
; These two macros do the beer job..
REM MAC Bottle
DEF MAC Bottle
WR %0,' Bottle',&
IF %0<>1\'s',&
END
' of Beer',&
IF %1\' on the Wall',&
END
'%2'
EM
REM MAC Beer
DEF MAC Beer ; jr_31jan97
ADD SYM.I=99T
BAS=T
COU 99T
Bottle:.I,TRUE,','
Bottle:.I,FALSE,'.'
' Take one down, pass it around,'
.I=.I-1
Bottle:.I,TRUE,'.'
''
END
EM
Beer:
/*25.09.2000 by AMi amiundyvonne@web.de*/ <mailto:amiundyvonne@web.de*/>
DECLARE @beer INT
SELECT @beer=99
nextBeer:
IF @beer=0 GOTO noBeer
SELECT CONVERT(VARCHAR,100-@beer)+' bottles of beer on the wall,'
SELECT CONVERT(VARCHAR,@beer)+' bottles of beer,'
SELECT 'take one down and pass it around,'
SELECT @beer = @beer - 1
GOTO nextBeer
noBeer:
SELECT 'NO MORE BOTTLES OF BEER ON THE WALL'
SELECT 'NO MORE BOTTLES OF BEER'
SELECT 'GO TO THE STORE AND BUY SOME MORE'
SELECT '99 BOTTLES OF BEER'
( 99 Bottles Of Beer, in MUF )
( by Mouse of HoloMUCK, 2003-03-07 )
( Link an exit to this, then invoke it with the starting bottle count. )
: say me @ swap notify ;
: beer
atoi dup not if pop 99 then 2 -1 for
dup intostr " bottles of beer on the wall" strcat say
dup intostr " bottles of beer" strcat say
"Take one down and pass it around" say
1 - intostr " bottles of beer on the wall" strcat say
" " say
loop
"1 bottle of beer on the wall" say
"1 bottle of beer" say
"Take it down and pass it around" say
"No more bottles of beer on the wall" say
" " say
"...no more beer?" say
;
Mumps is now called M or cache but it was originally called Mumps.
See http://www.camta.net/aboutm.htm
; The following is a single line of code
beer ; Randy M. Hayman (haymanr@icefog.alaska.edu)
for i=99:-1:1 w !,i," bottle",$S(i=1:"",1:"s"),
" of beer on the wall, ",i," bottle",$S(i=1:"",1:"s"),
" of beer.",!,"Take one down, pass it around, ",
i-1," bottle",$S(i=2:"",1:"s")," of beer on the wall.",!
BEER ; 99 bottles of beer song written in mumps (Brian Buydens)
N STR,I,BOT
S STR="bottle^bottles^of beer^on the wall^Take one down and pass it
around"
F I=99:-1:1 D
. S BOT=$P(STR,"^",2) I I=1 S BOT=$P(STR,"^",1)
. W !,!,I_" "_BOT_" "_$P(STR,"^",3)_" "_$P(STR,"^",4)_"."
. W !,I_" "_BOT_" "_$P(STR,"^",3)_"."
. W !,$P(STR,"^",5)_", "
. S BOT=$P(STR,"^",2) I I=2 S BOT=$P(STR,"^",1)
. I I>1 W !,(I-1)_" "_BOT_" "_$P(STR,"^",3)_" "_$P(STR,"^",4)_"."
. I I=1 W !,"No more bottles of beer on the wall."
Stuff to program multi-user games on the net.
A bunch of drunk engineers(#54326) Owner: eric.korpela Key:
eric.korpela(#54351PeoZ) Money: 2 You see a bunch of engineers
from a south bay firm who look like they've had a bit too much
to drink. They are random walking all over town, stopping where
ever they can find approprate beverages. I bet they'd sing
"99 bottles of beer" if you asked them to.
Listen: *sing*99*
Ahear: use me;
@wait 3={
@while gt(V(vi),1)={
@if eq(V(vj),V(vi))=think,{@trigger me/vy;@decrement me/vj}
};
@wait DONE=:collapses into an algoholic stupor.
}
VY: say concat(V(vi),bottles of beer on the wall!);
say concat(V(vi),bottles of beer.);
say You take one down, and pass it around;
@decrement me/vi;
say concat(V(vi),bottles of beer on the wall.);
@emit
Ause: @vi me=99;@vj me=100
Ouse: takes a deep breath and begins to sing.
Scent: They smell of 43 different types of liquor.
Functions: #69