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
b5   Baan 3GL   Babbage's analytical machine   BASIC   BasicBasic   BBC Basic   BC for unix   BCPL   Beatnik   BefDC   Befunge   Beta   bind   Blank   Blaster Master Pascal   BLISS (bliss style)   BLISS (procedural style)   BlitzBasic   BlooP   Bobo   Bourne Again Shell   bourne shell   Boxer   Brainfuck   BRL   BS   Bullfrog   Bywater Basic   bzip2  
 
  Programming language: b5
 
///  b5 version of 99 bottles of beer
///  Laurent Vogel,  http://lvogel.free.fr
///  b5 url: http://sange.fi/~atehwa/b5/
///  run as: echo | b5 THIS_FILE

mac nl i => i<<<
>>>;;;
mac t i => <<<Take one down, pass it around>>>nl(i);;;
mac p n s c => n<<< bottle>>>s<<< of beer>>>nl(c);;;
mac w i => <<< on the wall>>>i;;;
mac a n => p(n)(s)(w(.))nl()p(n)(s)(w(,))p(n)(s)(.)t(,);;;
mac b n m => a(n<<<>>>m);;;
mac c n => b(n)(8)b(n)(7)b(n)(6)b(n)(5)b(n)(4)b(n)(3)b(n)(2);;;
mac d n => b(n)(9)c(n)b(n)(1)b(n)(0);;;
data
p(99)(s)(w(,))p(99)(s)(.)t(,)c(9)b(9)(1)b(9)(0)d(8)d(7)d(6)d(5)d(4)d(3)
d(2)d(1)c()p(1)()(w(,))nl()p(1)()(w(,))p(1)()(.)t(,)p(No
more)(s)(w(.));;;
 
  Programming language: Baan 3GL
 
|********************************************************
|* Run this from the Baan shell
|* By Stark Springs, 18th June 2002
|********************************************************
function main()
{
    long wnd,i

    wnd=new.window(22, 80, 1, 1)
    scroll(wnd)
    for i=99 to 1 step -1
        print i, " bottle(s) of beer on the wall,", cr$(), lf$()
        print i, " bottle(s) of beer.", cr$(), lf$()
        print i-1, " bottle(s) of beer on the wall.", cr$(), lf$(2)
        refresh(wnd)
    endfor
    message("")
}

 
  Programming language: Babbage's analytical machine
 
This is an emulation of Babbage's original design.  
Details and the emulator may be found at 
<a href=http://www.fourmilab.ch/babbage/>http://www.fourmilab.ch/babbage/</a>

. 99 bottles of beer song
. written for Babbage's Analytical Engine with Attendant
. by Greg Cook 15/1/1998
. Attendant converts flow structure to conditional jumps

. No new line after number
A write in columns

. constants
N000  0
N001  1
N002  2

. bottle count
N003 99

(?
-
L003
P
. finish subtraction to compare bottles to 1
L002
{?
A write annotation  bottles
}{
A write annotation  bottle
}
A write annotation  of beer on the wall,
A write new line

. new subtraction card to clear mill
-
L003
P
L002
{?
A write annotation  bottles
}{
A write annotation  bottle
}
A write annotation  of beer,
A write new line
A write annotation Take one down and pass it around,
A write new line

. Still subtracting, update counter
L003
L001
S003
. compare for 0 this time
L003
L001
{?
. if <=0 then don't finish verse
-
L003
P
L002
{?
A write annotation  bottles
}{
A write annotation  bottle
}
A write annotation  of beer on the wall.
A write new line
A write new line
}
. if >0 then continue loop
L000
L003
)
A write annotation No more bottles of beer on the wall!
A write new line
 
  Programming language: BASIC
 
10 REM Basic version of 99 bottles of beer
20 FOR X=100 TO 1 STEP -1
30 PRINT X;"Bottle(s) of beer on the wall,";X;"bottle(s) of beer"
40 PRINT "Take one down and pass it around,"
50 PRINT X-1;"bottle(s) of beer on the wall"
60 NEXT
 
  Programming language: BasicBasic
 
rem BasicBasic version of 99 Bottles of beer (Bottles.bas)
rem See http://www.programmersheaven.com/search/Download.asp?FileID=16394
rem Philipp Winterberg, http://www.winterbergs.de

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$; "."
  print
next b      
if ostype = 1 then
  do while inkey$=""
  loop
end if
end
 
  Programming language: BBC Basic
 
REM BBC BASIC version of 99 Bottles of beer (Bottles.bbc)
REM See: http://www.bbcbasic.com/
REM Philipp Winterberg, http://www.winterbergs.de
      
FOR b=99 TO 1 STEP -1
  PRINT 'b;, " bottle(s) of beer on the wall,"
  PRINT b;,, " bottle(s) of beer."
  PRINT ,,,, "Take one down, pass it around,"
  PRINT b-1; " bottle(s) of beer on the wall."
NEXT b
 
  Programming language: BC for unix
 
/* 99 bottles of beer in Unix bc                                          */
/* by Adam Roach <adam.roach@exu.ericsson.se>                             */
/*                                                                        */
/* In theory, this could be shortened by functions, but the version of    */
/* bc that I have access to doesn't allow functions... so this is long... */

i = 99
while ( i > 0 ) {
  if (i/10 == 1) "1"
  if (i/10 == 2) "2"
  if (i/10 == 3) "3"
  if (i/10 == 4) "4"
  if (i/10 == 5) "5"
  if (i/10 == 6) "6"
  if (i/10 == 7) "7"
  if (i/10 == 8) "8"
  if (i/10 == 9) "9"
  if (i%10 == 0) "0 bottle"
  if (i%10 == 1) "1 bottle"
  if (i%10 == 2) "2 bottle"
  if (i%10 == 3) "3 bottle"
  if (i%10 == 4) "4 bottle"
  if (i%10 == 5) "5 bottle"
  if (i%10 == 6) "6 bottle"
  if (i%10 == 7) "7 bottle"
  if (i%10 == 8) "8 bottle"
  if (i%10 == 9) "9 bottle"
  if (i != 1) "s"
  " of beer on the wall,
"
  if (i/10 == 1) "1"
  if (i/10 == 2) "2"
  if (i/10 == 3) "3"
  if (i/10 == 4) "4"
  if (i/10 == 5) "5"
  if (i/10 == 6) "6"
  if (i/10 == 7) "7"
  if (i/10 == 8) "8"
  if (i/10 == 9) "9"
  if (i%10 == 0) "0 bottle"
  if (i%10 == 1) "1 bottle"
  if (i%10 == 2) "2 bottle"
  if (i%10 == 3) "3 bottle"
  if (i%10 == 4) "4 bottle"
  if (i%10 == 5) "5 bottle"
  if (i%10 == 6) "6 bottle"
  if (i%10 == 7) "7 bottle"
  if (i%10 == 8) "8 bottle"
  if (i%10 == 9) "9 bottle"
  if (i != 1) "s"
  " of beer.
"
  i = i - 1 
  "Take one down, pass it around.
"
  if (i/10 == 1) "1"
  if (i/10 == 2) "2"
  if (i/10 == 3) "3"
  if (i/10 == 4) "4"
  if (i/10 == 5) "5"
  if (i/10 == 6) "6"
  if (i/10 == 7) "7"
  if (i/10 == 8) "8"
  if (i/10 == 9) "9"
  if (i%10 == 0) "0 bottle"
  if (i%10 == 1) "1 bottle"
  if (i%10 == 2) "2 bottle"
  if (i%10 == 3) "3 bottle"
  if (i%10 == 4) "4 bottle"
  if (i%10 == 5) "5 bottle"
  if (i%10 == 6) "6 bottle"
  if (i%10 == 7) "7 bottle"
  if (i%10 == 8) "8 bottle"
  if (i%10 == 9) "9 bottle"
  if (i != 1) "s"
  " of beer on the wall.

"
}
quit
 
  Programming language: BCPL
 
// BCPL version of 99 Bottles of Beer.
// hacked by Akira KIDA <SDI00379@niftyserve.or.jp>

GET "LIBHDR"

MANIFEST $(
    BOTTLES = 99
$)

LET START() BE $(
    LET BEERS(N, S) BE $(
        TEST N = 0 THEN WRITEF("No more bottles")
                   ELSE WRITEF("%N bottle%S", N, (N = 1) -> "", "s")
        WRITEF(" of beer%S", S)
    $)

    FOR I = BOTTLES TO 1 BY -1 DO $(
            BEERS(I, " on the wall, ")
            BEERS(I, ".*NTake one down, pass it around.*N")
            BEERS(I - 1, " on the wall.*N")
    $)
    FINISH
$)
 
  Programming language: Beatnik
 
See http://www.cliff.biffle.org/esoterica/beatnik.html for more
informations about Beatnik.
99 Bottles of Beer in Beatnik from Paul Dale.


orb hunter outboards almehs iceleaf feeding cappers frase stint
benzophenoxazine genius censual bet a scarpings a segue hoddin saccules
arere benzoxyphenanthrene tipit pasteur aitus incrystallizable repolon
unona a cordovan tien urent a learnership reacclimatized loris backfurrow
bloodlust pulau misbuilt garad ume a stof releasable slog a stanine
unvail seron a yuppies siri snars a waitingly immortalizer columnal
tours mesmerises tulip alcoate ecritoires tip hatchety asper grossularia
lapsed dottled runts a outfrown loro inust a undersweep refurbishment
harmans roral alamosite toilets prerent sleekier notus eale bolti
torturers irone theologicometaphysical pereion sosia a furcated po lood
a contrabands hematomyelitis reffos slad cloyingly didus alnilam titre
interzygapophysial septole lung fibrohemorrhagic tucum slid a purlieuman
gau unais a bridemaids jacketed tawdrier nong pneumatist durant danseuse
ringsiders selle nab smog ceratin tsars deflexionize arillode paddled daut
a burin rimpi torrs a dumpiness outs sutra a confirmee monarchomachist
tenesmic gout leis tealess scaturient leggier korun ungroaning netes
grewhound berun averin sued zubeneschamali monists alias a auspicates ions
ah a dewberries hypophrenosis glaciaria rales lockouts lingua unmitre
antinormal saris sufflue reallot flurrs tup microspectroscopic barrier
gaus a begunks red spa a smirkly expediently outslink rerun birthplace
desine palsies awayes lum egress snurp bialate wiretap tirrs ids ananias
wallet agas a habaneras rag suine a gossipping eulamellibranchia hu
overspecialized oceanet ponderate serio epiloguize scian rarish unfilled
unilinear estre a blowth tine intil a unimmerged typonymic anour epineural
monal wellanear toruloid scillas tonna deanthropomorphization linolic
sists lick avises riant a pentameran ago sorts a volubleness propagability
returfer pandrop wergild wealsmen andy nam zygomaticomaxillary reedes
riband annal a warlike a tored elatedness foetation pot benzophenoxazine
arrouse ahem stilt a ungrapple lote duro a greasebush pyramidoprismatic
turus unformularizable vogul lilos umbraculiferous herblet tensile
vilely syes arras a gaup glissandos loge a boris partite coregnant
eater plantarium crois bistres ame a braking tela arist a unsparingness
tranquillizing plunks egol verbenaceous brere underslip outgoers moarian
skittler roost sleeping lemes fling isotropies gear real boron petum dues
a guayacan lull tegs a dandlingly mycorhiza guao quinquevalency edicts
sprayer urian deconcentrate eaglet dicier gere phenolsulphonephthalein
foder oriel buzzwigs orcines nassellarian gona drawstop entasia dueling
tutor a impeding unto rim a warrantable saccharostarchy glossily aden
sade aldols redoom nintu pythagoreanize felter cornetists sault a piste
bolster arnee a puncher em aurei a misworded zenocentric lurches isles
rens ahir wheres pudors drek romescot taler congealedness sapan uncolts
urge hypsibrachycephalic mislies leare a autotheater sero lasso a cypraeid
projiciently lairs blamer cubes goel misgovernment occlude brule wainman
conal edible nevadite sward erose a lubricious gan pus a amidoacetal
solemnizing inurements orias beek sauger dipole distringas urial sail
usnic tenonitis gate mizzenmast holour begetters edea alternationist
inlaid tasseled structural roter selenigenous lullian brattie onset
a wombats tins arest a shovelnose hyperparasitize encomion trots noll
auronal attenuant lido characterization simurg emplead geit rus toader
serpens trioecious coo dispark disert abram doto a homaroid arar nills
a misinterpret bolshevistically kedger tilia baluchithere veg alumnae
diablerie lions nimbly carts unstrand seral benzdioxtriazine venge
tolan nonoxidizable daks udos a countersign lene iglu a bacteroidal
housewifeship remolades doer porogamous means bargee unhalted osmanli
bodily slete babblement tannins streetful bestud scoriae relie a zolle
tort ureas a manically superpublicity loure pharyngoepiglottic rosarians
interleaf olena saices ameen hoolie koibal lutea contrafagotto remit
osteoma dout tranquillized poulter sparely bluster dita a tambourgi
gue rep a uninformed yezzy snipish talio excudit hant regosols
ballistite reata unsampled essenis dumose mamey guns pilgrimatical
cub danders obscener irous eructance stupa medius ace a isoclinics
rast dog a reaedifye confluxibility untin ssu tatted unrotted goas
thymolsulphonephthalein creeses pro landside imarets pia a huntington
toil luds a belching hazily abnormal domiciles caducei sesti isogonal
enrage presume trets a graven rescreens atilt a vindresser tri senna a
sotnik ber a adoringly sall stoat a anodically unexhaustiveness manrider
fleaseed ambients novelism earnests gies benzoxyphenanthrene oilless
lanks atlee a farriery a rogan nutricial accessit dug zygomaticomaxillary
ladler soredial least a interrupters stun deen a contributed whizzle poa
oxyphosphate simians looie psychoneurosis shauling batta oligopnea sutlers
soter a liangs arrowroot lorel a conte lunulites luctations tilts pfenning
nilgau basoga tetra a revivers aria diau a reprehends nonsympathizer
positioner lotes contributive meter nonattention astatines trendies
orifice stod tatouays imid tubage fuligula norie ida corin aerotrain
outer a overstay tina gool a rearrangement hypophyllous pul razzmatazes
sourtop chords ornis oximeters sartain brittle steal zygomaticosphenoid
evade con anorthographically esodic dag a repeatable snot saunt a katydid
masquerading fringier rores vicarious leglen incisal metastasis land
rigs etatist avania uca lymphotoxemia mullers ords a placoidei sets
ador a syncretic hematozoal avocate norna a telic travel telfairia bit
roll ulcer gopak pieing legman fettling ardu coadunative monel rougy fe
pachycephalic pressor neons a ponderated sala aures a adjurers
supersulphurize unirritated sauts propleural balti metaler pyning lento
palliyan elitist sergette lind quadriphyllous kam laura a ulnocarpal
nene sains a mittelhand clockmaker vallums trial squirmer stoep peludo
catatonias tools potes auroral tattling ferriage alula ilia gram lanolines
dari pterygopharyngeal wisent tiros a macruroid snit oisin a peltiferous
brachistochronous fantoms toles dolichopodous gunge tordions cinch acetite
gens mintages rondle recalling roping owing desi hypsibrachycephaly
proteus guts primer sanko tests purgers insetted teaer a maumetries laid
mutagens aulos a hepaticas dephilosophize worseness metatantalic sonnes
tektite radicules unrepentance bionics bedrocks
 
  Programming language: BefDC
 
This was created partially to frustrate a programming instructor (not 
that that isn't a worthy goal) and 99BoB was used to test the 
language constructs.  It's a combination of Befunge and a desk 
calculator.  Details at 
<a href=http://www.cs.su.oz.au/~sholden/BefDC>http://www.cs.su.oz.au/~sholden/BefDC

>9999*++000s1100sXv<     >#v100g5-v
X              >100g3-   |v       _@
               |-2g001_ v
v *39s1010pg000  s0012-#<  <
vv*35s1010pg000<      1
v##      *47s1011s0014g# <
v*35s1010<Xs000-1g000s0011<
X>3100sv              0
^      <              1
                      ^
{
000              >         x
v        s100+1g100   <
>001g101g9gp001g201g -|
s                     0
1                     0
0                     0
2        xv#    <     1
^         >000v       s
          v0pg<       P
          0           x
          g
         ^_5100s^
{
100 bottles of beer.
{
In BefDC - a derivative of Befudge and dc, by Sam Holden
{
This code by Sam Holden, 1997.
{
Note: this language was actually designed to do my cryptography assigments,
      which is why it is defined with 'infinite' precision math.
{
{
{
{
 bottles of beer on the wall
Take one down, pass it around
 
  Programming language: Befunge
 
v v0\1:\1:\0\0\!:p15-<     Bottles of Beer for Befunge
0 \ {befunge} >" ekaT">v   written by Brian Raiter, 5/97
0>>.0"llaw eht no "v<#,:   breadbox@muppetlabs.com
"\,     >"eno"^>0 #"^1^_v
c1,>51g#^_"ti"^. >vr :  $
"::^" down, pass "<e    5
>^|\*25,<^     # i e ^g1< 
  ,>052*":dnuor t"vbv:<
v0_^    .      , ^< " "
>52*".ll"v   >,^   fb e
v<v<v_$!|>"aw eht no r"v
""" ,:  >" ;"^      f ^<@
meo >^"bottle"<    "o   $
o m^"re:"<v  _^#g15<  v_^
s""  >52*^>"s"^v"les"<,:
"^<  ^"99 bott"<    >^>^<
>" yub ,erots eht ot oG"^
 
  Programming language: Beta
 
ORIGIN '~beta/basiclib/v1.4/betaenv';
--- program: descriptor ---
(* 99 bottles in BETA. Ole Villumsen, October 27, 1995. *)
(# putBottles: (# no: @integer;
               enter no
               do (if no//1 then '1 bottle' -> putLine;
                  else no -> putInt; ' bottles' -> putText;
                  if);
               #);
do (for i:99 repeat
     100-i -> putBottles; ' of beer on the wall,' -> putLine;
     100-i -> putBottles; ' of beer.' -> putLine;
     'Take one down, pass it around,' -> putLine;
     99-1 -> putBottles; ' of beer on the wall.' -> putLine; newLine;
   for)
#)
 
  Programming language: bind
 
'bind' is the internet domain name server from ISC (www.isc.org/bind) 
and is by far the most ubiquitous nameserver out there and a rather 
important part of the fabric of the internet. You need bind version 8 or 
9 for this to work.

Anyway, here goes:

zone-file (e.g. bottles-of-beer.example.com)
--------------------------------------------
$TTL 86400
$ORIGIN bottles-of-beer.example.com.
	IN	NS	ns.example.com.
	IN	SOA	ns.example.com. postmaster.example.com. (
			1 ; Serial
			28800 ; Refresh
			7200 ; Retry
			604800; Expire
			600 ) ; Minimum
$GENERATE 2-99 $ CNAME ${-1}
1	IN	CNAME	no
no	IN	A	127.0.0.1
---------------------------------------------

The $GENERATE statement represents a list of entries in the zone file.
The fact that it supports some arithmatic allows us to generate this:

99.bottles-of-beer.example.com IN CNAME 98.bottles-of-beer.example.com
98.bottles-of-beer.example.com IN CNAME 97.bottles-of-beer.example.com
...
1.bottles-of-beer.example.com IN CNAME no.bottles-of-beer.example.com

In DNS, a CNAME is a pointer to another entry in the DNS. And in this 
hack, that entry once again points to the next entry, etc., all leading 
to 'no bottles', which is the only entry with a 'real' IP-address.

To view this list, one could download the contents of the domain using 
e.g. dig:

dig @ns.example.com bottles-of-beer.example.com axfr

(This would show all generated entries)
 
  Programming language: Blank
 
This is a custom language project.  The compiler is available at 
<a href=http://www.sound.net/~aturley/blank.htm>http://www.sound.net/~aturley/blank.htm</a>

99 Bottles of Beer
Written in Blank
by Andrew Turley

[99] bottles of beer
{#} pop the last calling cell
[20]{>} call "x bottles of beer on the wall,"
[65]{>} call "x bottles of beer."
[98]{>} call "Take one down, pass it around,"
{:}[1]{-}{!}[7]{\}{|} if bottles of beer is not 1
[124]{>} call "x-1 bottles of beer on the wall!"
{?}[19]{-}{>} go back to the beginning of the program

[157]{>} otherwise goto "No bottles of beer on the wall!"

"x bottles of beer on the wall," :36+11
{:}{.} print bottles of beer
[0] string termination
[10] "\n"
[44][108][108][97][119][32][101][104][116][32][110][111][32] ",llaw
eht no " [114][101][101][98][32][102][111][32] "reeb fo "
[24]{^}[1]{-}[4]{\}{!}{|} [115] "s" [1]{>}{#}
[101][108][116][116][111][98][32] "elttob " [34]{>} call the printing
part of the program {<} return to calling cell

"x bottles of beer." :24+11
{:}{.} print bottles of beer
[0] string termination
[10] "\n"
[46][114][101][101][98][32][102][111][32] ".reeb fo "
[12]{^}[1]{-}[4]{\}{!}{|}
[115] "s"
[1]{>}{#}
[101][108][116][116][111][98][32] "elttob "
[34]{>} call the printing part of the program
{<} return to calling cell

"Take one down, pass it around" :35
[0] string termination
[10] "\n"
[44][100][110][117][111][114][97][32][116][105][32] ",dnuora ti "
[115][115][97][112][32][44][110][119][111][100][32] "ssap ,nwod "
[101][110][111][32][101][107][97][84] "eno ekaT" [38]{>} goto the
printing part of the program {<} return to calling cell

"x-1 bottles of beer on the wall!" :38
[1]{-}{:}{.} (print bottles of beer)-1
[0] string termination
[10] "\n"
[10] "\n"
[33][108][108][97][119][32][101][104][116][32][110][111][32] "!llaw
eht no " [114][101][101][98][32][102][111][32] "reeb fo "
[115][101][108][116][116][111][98][32] "selttob " [38]{>} goto the
printing part of the program {<} return to calling cell


"No bottles of beer on the wall!", terminating part of program :36 [0]
string termination [10] "\n"
[33][108][108][97][119][32][101][104][116][32][110][111][32] "!llaw
eht no " [114][101][101][98][32][102][111][32] "reeb fo "
[115][101][108][116][116][111][98][32][111][78] "selttob oN" [9]{>}
goto the printing part of the program {@} exit program

printing part of the program :13

{:}[7]{\}{!}{|}{#}{,}{?}[10]{-}{>} print the top of the stack until 0
{#} ppop the call {#} ppop the if {$} pop the 0 {<} return to calling
cell
 
  Programming language: Blaster Master Pascal
 
// Blaster Master Pascal version of 99 Bottles of beer (Bottles.pas)
// See http://www.programmersheaven.com/zone24/cat351/16888.htm
// Philipp Winterberg, http://www.winterbergs.de

entity x; .float b; Function Spawn (): entity; #2; 
Procedure WriteLn (...); #254;

Procedure Bottles ();
Begin
  local entity h; h:= Spawn (); x:= h; x.b:= 99;
  While (x.b > 0) Do
    Begin
      WriteLn('%f bottle(s) of beer on the wall,', x.b);
      WriteLn('%f bottle(s) of beer.', x.b);
      WriteLn('Take one down, pass it around,');
      x.b:= x.b - 1;
      WriteLn('%f bottle(s) of beer on the wall.\n', x.b);
    End;
End;
 
  Programming language: BLISS (bliss style)
 
module NINTY_NINE_BOTTLES_CT (main=BOTTLES) =
!
!   "99 Bottles of Beer on the Wall"
!   using BLISS on DIGITAL's Alpha OpenVMS
!   by Ron Brender, brender@zko.dec.com
!
begin

external routine
    printf	    : novalue	    external_name('DECC$GXPRINTF');
		    !
		    ! To "port" this program to UNIX or WNT, use
		    ! external_name('printf') or the appropriate lower case
		    ! compilation option instead of the above.
		      

macro
    PUT_TEXT(T) =
	printf(uplit(%asciz '%s'), uplit(%asciz T))
	%,
    PUT_NL (dummy) =
	printf(uplit(%asciz %string(%char(10))))
	%;

compiletime
    TEMP = 0;

! In principle, the complete text can be constructed at compile-time and
! output with a single PUT_TEXT call, however, that runs up against a
! compile-time maximum string length. This implementation constructs a
! complete stanza at compile-time.
!
macro
    BOTTLE_S(COUNT) =
	%if COUNT eql 1 %then 'bottle' %else 'bottles' %fi
	%,

    BOTTLE_COUNT(COUNT) =
	%assign(TEMP, COUNT)
	%if TEMP eql 0 %then 'No' %else %string(%number(TEMP)) %fi
	%,

    BOTTLE_STANZA(COUNT) =
	PUT_TEXT(%string(
	    BOTTLE_COUNT(COUNT), ' ', BOTTLE_S(COUNT),
		' of beer on the wall; ',
	    BOTTLE_COUNT(COUNT), ' ', BOTTLE_S(COUNT), ' of beer', %char(10),
	    'Take one down and pass it around', %char(10),
	    BOTTLE_COUNT(COUNT-1), ' ', BOTTLE_S(COUNT-1),
		' of beer on the wall', %char(10),
	    %char(10)))
	%,

    BOTTLE_TEXT(COUNT)[] =
	BOTTLE_STANZA(COUNT);
	%if COUNT gtr 1 %then
	    BOTTLE_TEXT(COUNT - 1)
	    %fi
	%;

global routine BOTTLES : novalue =
    begin

    ! Title
    !
    PUT_NL();
    PUT_TEXT('        "99 Bottles of Beer on the Wall"'); PUT_NL();
    PUT_NL();

    BOTTLE_TEXT(99);

    end;

end
eludom
 
  Programming language: BLISS (procedural style)
 
module NINTY_NINE_BOTTLES (main=BOTTLES) =
!
!   "99 Bottles of Beer on the Wall"
!   using BLISS on DIGITAL's Alpha OpenVMS
!   by Ron Brender, brender@zko.dec.com
!
begin

forward routine
    BOTTLES	    : novalue,	    ! Main routine
    BOTTLE_S	    : novalue,	    ! 'bottle<s>'
    BOTTLE_COUNT    : novalue;	    ! <n> or 'no'

external routine
    printf	    : novalue	    external_name('DECC$GXPRINTF');
		    !
		    ! To "port" this program to UNIX or WNT, use
		    ! external_name('printf') or the appropriate lower case
		    ! compilation option instead of the above.
		      

macro
    PUT_TEXT(T) =
	printf(uplit(%asciz '%s'), uplit(%asciz T))
	%,
    PUT_INT(N) =
	printf(uplit(%asciz '%*d'), if N lss 10 then 1 else 2, N)
	%,
    PUT_NL (dummy) =
	printf(uplit(%asciz %string(%char(10))))
	%;

global routine BOTTLES : novalue =
    begin

    ! Title
    !
    PUT_NL();
    PUT_TEXT('        "99 Bottles of Beer on the Wall"'); PUT_NL();
    PUT_NL();

    decr I from 99 to 1 do
	begin

	! <n> bottle<s> of beer on the wall; <n> bottle<s> of beer
	!
	BOTTLE_COUNT(.I); PUT_TEXT(' '); BOTTLE_S(.I);
	    PUT_TEXT(' of beer on the wall; ');
	BOTTLE_COUNT(.I); PUT_TEXT(' '); BOTTLE_S(.I); PUT_TEXT(' of beer');
	    PUT_NL();

	! Take <one|it> down and pass it around
	!
	PUT_TEXT('Take ');
	if .I eql 1 then PUT_TEXT('it') else PUT_TEXT('one');
	PUT_TEXT(' down and pass it around'); PUT_NL();

	! <n-1> bottle<s> of beer on the wall
	!
	BOTTLE_COUNT(.I-1); PUT_TEXT(' '); BOTTLE_S(.I-1);
	    PUT_TEXT(' of beer on the wall'); PUT_NL();

	! New stanza
	!
	PUT_NL();

	end;

    end;

routine BOTTLE_S (COUNT) : novalue =
    begin

    PUT_TEXT('bottle');
    if .COUNT neq 1 then PUT_TEXT('s');

    end;

routine BOTTLE_COUNT (COUNT) : novalue =
    if .COUNT eql 0 then PUT_TEXT('No') else PUT_INT(.COUNT);

end
eludom
 
  Programming language: BlitzBasic
 
; Alexander Nassian - http://www.aproxx.com

Global bottles=99
Global y=10
While Not (Bottles=1)
Text 20,x,Bottles + "bottles of beer on the wall " + Bottles + "bottles
of beer"
y=y+15
Text 20,x,"Take one down, pass it around"
y=y+15
Bottles=Bottles-1
Delay 10
Wend
Delay 3000
Cls
Text 20,10,"1 bottle of beer on the wall, one bottle of beer"
Text 20,25,"no more bottles of beer on the wall"
Delay 3000
End
 
  Programming language: BlooP
 
#  BlooP version of 99 bottles of beer
#  Laurent Vogel,  http://lvogel.free.fr
#  (BlooP implementation found at the retrocomputing museum)
#  (remove comment lines starting with #)
#
define procedure ''p''[n,c]:
block 0: begin
    cell(0) <= 's ';
    if n = 1, then: cell(0) <= ' ';
    cell(1) <= n;
    if n = 0, then: cell(1) <= 'No more';
    print[cell(1), ' bottle', cell(0), 'of beer', c];
    output <= n;
block 0: end.

define procedure ''pred''[n]:
block 0: begin
    loop at most n times:
    block 1: begin
        if output + 1 = n, then:
        abort loop 1;
        output <= output + 1;
    block 1: end;
block 0: end.

define procedure ''beer''[n]:
block 0: begin
    output <= n;
    loop n times: 
    block 1: begin
        output <= p[output, ' on the wall,'];
        output <= p[output, '.'];
        print['Take one down, pass it around,'];
        output <= pred[output];
        output <= p[output, ' on the wall.'];
        print[' '];
    block 1: end;
    output <= ' '
block 0: end.

beer[99].
 
  Programming language: Bobo
 
The author (below) created the language. "Bobo" is Spanish for idiot.
## 99.bb v1.2
## Bayard W. Wenzel

# some handy macros

/nprint {"\n" add print} def
/space {"\n" print} def
/dec {dup get 1 sub def} def
/class-define {{get invoke} bind pop-dict} def

# i will use the bobo object protocol! it is cool.

/new-bar {
  13 /bar-dict create-dict

  /count 0 def
  /lyric-type "I'm a computer, I can't decide what to say," def

  /set-count {/count exch def} def
  /set-lyric-type {/lyric-type exch def} def

  # proper grammar counts

  /bottle-thing {
    /i exch rdef

    i 1 eq {
      i " bottle" add print
    } {
      i " bottles" add print
    } if-else
  } def

  # and, the meat of it!

  /beer-lyrics {
    /i exch rdef

    i bottle-thing " of beer on the wall," nprint
    i bottle-thing " of beer!" nprint
    lyric-type nprint
    i 1 sub bottle-thing " of beer on the wall." nprint space
  } def

  /final-lyrics {
     "0 bottles of beer on the wall," nprint
     "0 bottles of beer." nprint
     "Go into town, buy a new round," nprint
     "Get some more bottles of beer on the wall!" nprint
  } def

  /consume {
    count {
      count beer-lyrics
      /count dec
    } {
      final-lyrics
    } if-else
  } def

  class-define
} def

/song {
  /lyric-type exch rdef
  /count exch rdef

  /bar new-bar rdef

  count /set-count bar
  lyric-type /set-lyric-type bar  

  count 1 add {/consume bar} loop
} def

/messy "If one of those bottles should happen to fall," def
/thirsty "Take one down, pass it around," def

99 thirsty song
 
  Programming language: Bourne Again Shell
 
#!/bin/bash
# Bourne Again shell version of 99 Bottles
# Dave Plonka - plonka@carroll1.cc.edu

typeset -i n=99
typeset bottles=bottles
typeset no

while [ 0 != $[ n ] ]
do
   echo "${n?} ${bottles?} of beer on the wall,"
   echo "${n?} ${bottles?} of beer,"
   echo "take one down, pass it around,"
   n=n-1
   case ${n?} in
   0)
      no=no
      bottles=${bottles%s}s
      ;;
   1)
      bottles=${bottles%s}
      ;;
   esac
   echo "${no:-${n}} ${bottles?} of beer on the wall."
   echo
done

exit
 
  Programming language: bourne shell
 
#!/bin/sh
# Bourne shell version of 99 Bottles
# Craig J Copi - copi@oddjob.uchicago.edu
#
if [ $# -eq 1 ]; then
	beers=$1
else
	beers=99
fi

s="s"

while [ $beers -gt 0 ]; do
	echo "$beers bottle$s of beer on the wall,"
	echo "$beers bottle$s of beer,"
	echo "take one down, pass it around,"
	beers=`expr $beers - 1`
	if [ $beers -ne 0 ]; then
		test $beers -eq 1 && s=""
		echo "$beers bottle$s of beer on the wall."
	else
		echo "no bottles of beer on the wall."
	fi
	echo
done

echo
echo "Time to buy some more beer . . . ."
 
  Programming language: Boxer
 
Boxer is an editor for DOS/OS2 environment. See www.boxersoftware.com/users/dhamel

* 99 bottles of beer on the wall
* In the Boxer macro language
* Load / Compile this macro
* And execute by pressing :
* CTRL-A
* ALT-Y
* 98 <enter>
* CTRL-B
*
* Written by Gavin Spearhead 1997
* wieger1@noord.bart.nl

<macro=1><name="init beer">
99<sp>bottles<sp>of<sp>beer<sp>on<sp>wall<enter>99<sp>bottles<sp>of<sp>beer
<enter>Take<sp>one<sp>down,<sp>pass<sp>it<sp>around<enter>98<sp>bottles<sp>
of<sp>beer<sp>on<sp>wall<enter>

<macro=2><name="Drink one">
<up><up><up><up><mark down><mark down><mark down><mark down><copy><down>
<enter><paste><decrement>1<enter><down><decrement>1<enter><down><down>
<decrement>1<enter><down>
 
  Programming language: Brainfuck
 
Yes, it's a dirty word.  An explanation and an interpreter of 
this can be found at 
<a href=http://www.cats-eye.com/cet/soft/lang>http://www.cats-eye.com/cet/soft/lang</a>.

>+++++++++[<+++++++++++>-]<[>[-]>[-]<<[>+>+<<-]>>[<<+>>-]>>>
[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]>[<+>-]>[<<++++++++++>>>+<
-]<<-<-]+++++++++>[<->-]>>+>[<[-]<<+>>>-]>[-]+<<[>+>-<<-]<<<
[>>+>+<<<-]>>>[<<<+>>>-]>[<+>-]<<-[>[-]<[-]]>>+<[>[-]<-]<+++
+++++[<++++++<++++++>>-]>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-
]<<<<<<.>>[-]>[-]++++[<++++++++>-]<.>++++[<++++++++>-]<++.>+
++++[<+++++++++>-]<.><+++++..--------.-------.>>[>>+>+<<<-]>
>>[<<<+>>>-]<[<<<<++++++++++++++.>>>>-]<<<<[-]>++++[<+++++++
+>-]<.>+++++++++[<+++++++++>-]<--.---------.>+++++++[<------
---->-]<.>++++++[<+++++++++++>-]<.+++..+++++++++++++.>++++++
++[<---------->-]<--.>+++++++++[<+++++++++>-]<--.-.>++++++++
[<---------->-]<++.>++++++++[<++++++++++>-]<++++.-----------
-.---.>+++++++[<---------->-]<+.>++++++++[<+++++++++++>-]<-.
>++[<----------->-]<.+++++++++++..>+++++++++[<---------->-]<
-----.---.>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>>+++
+[<++++++>-]<--.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.
><+++++..--------.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++
++++++++++++.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<++
+++++++>-]<--.---------.>+++++++[<---------->-]<.>++++++[<++
+++++++++>-]<.+++..+++++++++++++.>++++++++++[<---------->-]<
-.---.>+++++++[<++++++++++>-]<++++.+++++++++++++.++++++++++.
------.>+++++++[<---------->-]<+.>++++++++[<++++++++++>-]<-.
-.---------.>+++++++[<---------->-]<+.>+++++++[<++++++++++>-
]<--.+++++++++++.++++++++.---------.>++++++++[<---------->-]
<++.>+++++[<+++++++++++++>-]<.+++++++++++++.----------.>++++
+++[<---------->-]<++.>++++++++[<++++++++++>-]<.>+++[<----->
-]<.>+++[<++++++>-]<..>+++++++++[<--------->-]<--.>+++++++[<
++++++++++>-]<+++.+++++++++++.>++++++++[<----------->-]<++++
.>+++++[<+++++++++++++>-]<.>+++[<++++++>-]<-.---.++++++.----
---.----------.>++++++++[<----------->-]<+.---.[-]<<<->[-]>[
-]<<[>+>+<<-]>>[<<+>>-]>>>[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]
>[<+>-]>[<<++++++++++>>>+<-]<<-<-]+++++++++>[<->-]>>+>[<[-]<
<+>>>-]>[-]+<<[>+>-<<-]<<<[>>+>+<<<-]>>>[<<<+>>>-]<>>[<+>-]<
<-[>[-]<[-]]>>+<[>[-]<-]<++++++++[<++++++<++++++>>-]>>>[>+>+
<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>[-]>[-]++++[<++++++++>
-]<.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.><+++++..---
-----.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++++++++++++++
.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<+++++++++>-]<-
-.---------.>+++++++[<---------->-]<.>++++++[<+++++++++++>-]
<.+++..+++++++++++++.>++++++++[<---------->-]<--.>+++++++++[
<+++++++++>-]<--.-.>++++++++[<---------->-]<++.>++++++++[<++
++++++++>-]<++++.------------.---.>+++++++[<---------->-]<+.
>++++++++[<+++++++++++>-]<-.>++[<----------->-]<.+++++++++++
..>+++++++++[<---------->-]<-----.---.+++.---.[-]<<<]
 
  Programming language: BRL
 
<!--
 BRL version of 99 bottles of beer
 http://brl.codesimply.net/ 
 Bruce Lewis doubts he could use correct grammar after 98 beers.
 -->

[(let drink ((bottles 99))
   (brl-when (positive? bottles)
     ]<p>[bottles] bottles of beer on the wall;
      [bottles] bottles of beer!<br>
      Take one down, pass it around;
      [(- bottles 1)] bottles of beer on the wall!</p>
[    (drink (- bottles 1))))
 
  Programming language: BS
 
#!/usr/bin/bs
# bs version of 99 Bottles
# Dave Plonka - plonka@carroll1.cc.edu
# Thu Aug  8 1996

fun sing(n, end) s
   s = ("s", "")[ match(n, "^1$") ]
   put = format(format(format("%s bottle%%s of beer%%%%s", n), s), end)
nuf

for n = 99, n, put = ""
   sing(format("%-0.0f", n), " on the wall,")
   sing(format("%-0.0f", n), ",")
   put = "take one down, pass it around,"
   --n
   sing((format("%-0.0f", n), "no")[ 0 == n ], " on the wall.")
next

run
exit
 
  Programming language: Bullfrog
 
99 Bottles of Beer in Bullfrog
By Ryan Kuserny http://members.tripod.com/rkusnery/index.html

99
beer:
dup outn bottles doutsn wall doutsn
dup outn bottles doutsn dots doutsn
--
dup --!(onlyone morebeer-)*morebeer+jump
morebeer:
dup outn bottles doutsn wall doutsn
10 out
beer jump
onlyone:
onebottle doutsn wall doutsn
10 out
onebottle doutsn wall doutsn
onebottle doutsn dots doutsn
nomore doutsn bottles doutsn wall doutsn
end
bottles: " bottles of beer" datab 0
wall: " on the wall.
" datab 0
dots: "...
Take one down, pass it around,
" datab 0
onebottle: "One bottle of beer" datab 0
nomore: "No more" datab 0
 
  Programming language: Bywater Basic
 
10 rem Bywater Basic version of 99 Bottles of beer (Bottles.bas)
15 rem See http://www.programmersheaven.com/zone6/cat700/15918.htm
20 rem Philipp Winterberg, http://www.winterbergs.de
30      
40 for b=99 to 1 step -1
50   print str$(b) + " bottle(s) of beer on the wall,"
60   print str$(b) + " bottle(s) of beer."
70   print  "Take one down, pass it around,"
80   print str$(b-1) + " bottle(s) of beer on the wall." + chr$(13) + chr$(10)
90 next b
99 end
 
  Programming language: bzip2
 
Here comes the song, compressed by bzip2 (v 1.0.2).

42 5A 68 39  31 41 59 26  53 59 AC A4  E3 4E 00 06
B5 DF 80 00  10 40 04 7F  E0 10 00 04  00 37 6D DE
80 50 04 18  10 10 40 78  02 35 20 6F  7A AA A8 00
00 68 18 C0  01 30 00 13  04 A7 EA AA  80 68 1F EA
A1 A0 00 18  C0 01 30 00  13 02 95 14  D4 32 69 A0
D0 0D 3D 34  9E D9 95 67  2D C8 88 88  88 88 88 88
88 88 88 88  88 88 88 88  88 88 88 88  88 88 88 88
88 88 88 88  88 88 88 88  88 88 88 8C  08 88 88 88
88 88 88 88  88 88 88 88  88 88 9A D6  B3 26 64 EF
D2 4C CC 9F  59 99 32 66  71 BD 57 AB  D7 EC F6 FB
BD FB 38 01  E0 E4 0E C3  A0 74 0E C3  90 3C 1C 00
D9 A0 0A C0  05 BA D5 B6  DB 5B 38 01  E0 E4 0E C3
A0 74 0E C3  90 3C 1C 00  D9 A0 0A C0  02 DD 6A DB
6D AD 9C 00  F0 72 07 61  D0 3A 07 61  C8 1E 0E 2D
B6 DF 2D D0  05 60 03 EB  26 66 4F 4C  C9 33 32 7A
64 99 99 38  93 2B 37 32  AC FA B3 2A  CE 4B 32 AC
F7 B8 80 00  00 00 00 00  00 00 00 00  00 00 00 00
00 00 01 20  00 00 00 00  00 00 05 CF  99 56 73 66
55 9B BB BB  BB BB C7 87  00 1B DE F7  BD EF 77 97
00 D8 00 00  B6 E4 92 EA  DB 68 00 28  01 92 43 80
00 02 80 5C  92 0E 40 00  0A 03 79 24  0E 80 00 0A
07 99 24 07  60 00 05 07  79 24 03 C0  00 02 87 59
24 01 B0 00  02 8E 72 48  01 6D B6 DB  68 05 38 99
27 D3 52 66  64 FB 49 99  93 FD 92 61  6E A1 6D 42
C4 24 79 D0  B1 42 C5 0B  AD 0B 55 0B  58 91 F3 12
3E 22 46 D1  23 F9 42 DF  42 EB 42 D1  42 DD 12 32
A1 68 A1 71  A1 76 A1 66  85 DE 89 1B  D2 0D B0 AB
F6 85 D2 85  A5 0B 8C 48  E1 42 D6 85  98 91 9A 17
6A 16 8A 17  94 48 F1 28  59 50 B1 42  FF 17 72 45
38 50 90 AC  A4 E3 4E

Altogether 473 Bytes.

A little background, from the man page:

bzip2 compresses files using the Burrows-Wheeler block
sorting text compression algorithm, and Huffman coding.
Compression is generally considerably better than that
achieved by more conventional LZ77/LZ78-based compressors,
and approaches the performance of the PPM family of sta­
tistical compressors.
 
  © Oliver Schade <os@ls-la.net>, Generated: 06.06.2003 17:38:31