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
UBasic   UltraMacros   unbabtized   Universe BASIC   Unix DC   Unlambda   UnrealScript   Usertalk  
 
  Programming language: UBasic
 
10 ' UBasic version of 99 Bottles of beer (Bottles.bas)
15 ' See http://www.thefreecountry.com/developercity/basic.shtml
20 ' Philipp Winterberg, http://www.winterbergs.de
30      
40 for b=99 to 1 step -1
50   ? b, " bottle(s) of beer on the wall,"
60   ? b, " bottle(s) of beer."
70   ? "Take one down, pass it around,"
80   ? b-1, " bottle(s) of beer on the wall."
90   ?
99 next
 
  Programming language: UltraMacros
 
start
B:<all><oa-q esc>1<rtn>3<rtn>1<rtn>BottlesOfBeer<rtn x=99 begin print x>
bottles of beer on the wall,<rtn print x> bottles of beer,<rtn>Take one
down, pass it around,<rtn x=x-1 print x> bottles of beer on the wall.<rtn
rtn ifnot x=0 rpt elseoff>!
 
  Programming language: unbabtized
 
Use only the lines with numbers below!
Philipp Winterberg, http://www.winterbergs.de

!0,99.!1,1.,.@°0.:98.:111.:116.:116.:108.:101.:40.:115.:41.:32.:111
.:102.:32.:98.:101.:101.:114.:32.:111.:110.:32.:116.:104.:101.:32
.:119.:97.:108.:108.:44.:13.:10.@°0.:98.:111.:116.:116.:108.:101
.:40.:115.:41.:32.:111.:102.:32.:98.:101.:101.:114.:46.:13.:10.:84
.:97.:107.:101.:32.:111.:110.:101.:32.:100.:111.:119.:110.:44.:32
.:112.:97.:115.:115.:32.:105.:116.:32.:97.:114.:111.:117.:110.:100
.:44.:13.:10.(0,1.@°0.:98.:111.:116.:116.:108.:101.:40.:115.:41.:32
.:111.:102.:32.:98.:101.:101.:114.:32.:111.:110.:32.:116.:104.:101
.:32.:119.:97.:108.:108.:46.:13.:10.:13.:10.-0
 
  Programming language: Universe BASIC
 
* 99 Bottles of Beer on the Wall
* in UniVerse Basic by Brad Scheepers - 2003

$INSERT I_EQUATE
$INSERT I_COMMON

FOR X = 99 TO 1 STEP -1
	PRINT X:" Bottles of beer on the wall,"
	PRINT X:" bottles of beer."
	PRINT "Take one down, pass it around,"
	IF X <> 1 THEN PRINT X-1:" Bottles of beer on the wall.
NEXT X
	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 on the wall"

END
 
  Programming language: Unix DC
 
[ Sing the classic '99 Bottles of Beer', using the Unix dc utility.  ]sd
[                                                                    ]sd
[ Run this one by typing 'dc < bottles.dc' at the Unix prompt, where ]sd
[ bottles.dc is the file containing these lines.                     ]sd
[ Author: Kevin Quick  kquick@iphase.com                             ]sd
[                                                                    ]sd
[ bottles of beer]sb[ on the wall]sw[,]sc
[take one down, pass it around]st[.]sp[no more]sk
[10 13lplwlbln1-10 13lclt10 13lclbln32lclwlbln]sl
[lzxPPPPlzxPPPPPPPPlzxPPPPP]so[lkP]sx[dZselyxsd]su
[d10le1-dse^ /d10/10*-48+P le0<y]sy[d0=xd0<u]sz
[llxloxln1-dsn0<r]sr[Plf1-dsf0<g]sg
99snlrx10P
 
  Programming language: Unlambda
 
#  Unlambda version of 99 bottles of beer
#  Laurent Vogel,  http://lvogel.free.fr

````s``s``si`kk``s``s`ks``s`k`s`k``s``si`k`ki`kkk`k``s``s`ksk`k.9``s``s``s
``si`k`ki`kk`k`d`.9.1``s``s``s``si`k`ki`kk`k`d`.9.0``s``s``si`kk``s``s`k`s
``s`ks``s``s`ksk`k`s`k.9``s``s`ks``s`k`s`ks``s``s`ks``s`kk``s`ks``s`k`s`k`
`si`kkk`k``s``s`ks``s`kk``s`ksk`k``s`k`s``s`kskk`k``s``s`ks``s``s`ksk`k`s`
k.1``s``s`ksk`k`s`k.0``s``si`k`ki`kk``s``s``s`k`s``si`k``s`k.9.1``s``s`ks`
`s``s`ks``s`k`s`k``si`kkk`k``s``s`ksk`k``s``s`ksk`k.1`k``s``si`k``s`k.1.1`
`si`k``s`k.0.1``s``si`k`ki`kk``s``s``s``si`k`ki`kk`k.9``s``s``si`kk``s``s`
ks``s`k`s`k``s``si`k`ki`kkk`ki``s`k``s`kr``s`k..``s``s``si`k`ki`kk``s``s``
si`kk`k`ki``s`k.s``s``s``si`kk`kk``s`k`d`.r`.o`.m`.
`.o`.N.e``s``s``si`k`k
i`k`ki``s``s``si`kk`k`ki``s``s``si`kk`kk``s`k.1``s`kr``s`k.,``s``s``si`k`k
i`kk``s``s``si`kk`k`ki``s``s``si`kk`kk``s`k.1``s`kr``s`kr``s`k..``s``s``si
`k`ki`kk``s``s``si`kk`k`ki``s``s``si`kk`kk``s`k.1`ki``s``si`k`ki`k`ki```s`
`s``si`kk``s``s``si`kk``si`k`ki``s`k``s``s`ks``s`k`s`k``s``si`k`ki`k`kik``
s``s`ks``s`k`s`k``s``si`kk`k`kik``s`k`s`k.s``s``s`ks``s`k`s`k``s``si`kk`kk
k``s`k`si``s`k`s`kr``s`k`s`k.,``s``s`ks``s`k`s`k``s``si`k`ki`kkk``s``s`ks`
`s`k`s`k``s``si`kk`k`kik``s`k`s`k.s``s``s`ks``s`k`s`k``s``si`kk`kkk``s`k`s
i``s`k`s`kr``s`k`s`kr``s`k`s`k.,``s``s`ks``s`k`s`k``s``si`k`ki`kkk``s``s`k
s``s`k`s`k``s``si`kk`k`kik``s`k`s`k.s``s``s`ks``s`k`s`k``s``si`kk`kkk`k``s
i`ki``si`k`ki``s``s`k``s``s``si`k`ki`k`ki``s``s``si`kk`k`ki``s`k.s``s``s``
si`kk`kk``s`k.9``s`k.9``s`kr``s`k.,``s``s``si`k`ki`kk``s``s``si`kk`k`ki``s
`k.s``s``s``si`kk`kk``s`k.9``s`k.9`ki``si`k`ki`k``s``si`k.8``s``si`k.7``s`
`si`k.6``s``si`k.5``s``si`k.4``s``si`k.3``si`k.2```s``si``s``si``s``si`k`d
`.,`.d`.n`.u`.o`.r`.a`. `.t`.i`.  `.s`.s`.a`.p`. `.,`.n`.w`.o`.d`.
`.e`.n`
.o`. `.e`.k`.a`.T`rr`k`d`.l`.a`.w`. `.e`.h`.t`. `.n`.o`.
.l``s``si`k`d`.e`
.e`.b`. `.f`.o`. .r`k`d`.l`.t`.t`.o`.b`.
.ei``s`k`s``s`ks``s`k`sik``s`kkki
 
  Programming language: UnrealScript
 
// 99 Bottles of Beer, in UnrealScript. Sings to every player
// simultaneously. Written for UT2003, but would work on other Unreal
// Engine games with little to no modification.
// Probably works on a network. I haven't checked.

// Written by "Dezro" Dave Smith: dezro@mac.com

class MutBottlesBeer extends Mutator;

var int StartingBottles;
var int CurrentBottle;
var int SongLine;
var bool Begun;
var bool StopSong;

function ModifyPlayer(Pawn Other)
{
	Super.ModifyPlayer(Other);
	if (!Begun)
	{
		CurrentBottle = StartingBottles;
		SetTimer(1.5, true);
		Begun = true;
	}
}

function Timer()
{
	local Controller C;
	local bool PassAround;

	if (StopSong)
	{
		SetTimer(0.001, false);
		return;
	}

	for (C = Level.ControllerList; C != None; C = C.NextController)
	{
		Switch (SongLine)
		{
		Case 0:
			if (CurrentBottle == 1)
				C.Pawn.ClientMessage("One bottle of beer on the wall,");
			else
				C.Pawn.ClientMessage(CurrentBottle $ " bottles of beer on the wall,");
			Break;
		Case 1:
			if (CurrentBottle == 1)
				C.Pawn.ClientMessage("One bottle of beer.");
			else
				C.Pawn.ClientMessage(CurrentBottle $ " bottles of beer.");
			Break;
		Case 2:
			if (CurrentBottle == 1)
				C.Pawn.ClientMessage("Take it down, pass it around,");
			else
				C.Pawn.ClientMessage("Take one down, pass it around,");
			PassAround = true;
			Break;
		Default:
			if (CurrentBottle == 1)
				C.Pawn.ClientMessage("One bottle of beer on the wall.");
			else if (CurrentBottle < 1)
			{
				C.Pawn.ClientMessage("No more bottles of beer on the wall!");
				StopSong = true;
			}
			else
				C.Pawn.ClientMessage(CurrentBottle $ " bottles of beer on the wall.");
			Break;
		}
	}
	if (PassAround)
	{
		CurrentBottle--;
		PassAround = false;
	}
	SongLine++;
	if (SongLine > 3)
		SongLine = 0;
}

defaultproperties {
	FriendlyName="99 Bottles"
	Description="Sings to you during the battle."
	StartingBottles = 99
}

 
  Programming language: Usertalk
 
on ninetyNineBottles() {
  local {
    lyrics = "";
    bottleStartCount = 99;
    bottleString = "";
    eol = "\r"};

  on numBottles(theCount) {
    local {
      s = ""};
    case theCount {
      0 {
        s = "No more bottles"};
      1 {
        s = "1 more bottle"}}
    else {
      s = theCount + " bottles"};
    return(s)};

  on finishVerse(theCount) {
    local {
      s = "Take one down and pass it around, " + eol};
    s = s + numBottles(theCount - 1) + " of beer on the wall."\
    + eol + eol;
    return(s)};

  for bottleCount = bottleStartCount downto 1 {
    bottleString = numBottles(bottleCount);
    lyrics = lyrics + bottleString + " of beer on the wall, "\
    + bottleString + " of beer." + eol + finishVerse(bottleCount)};
  lyrics = lyrics + "No more bottles of beer on the wall, "\
  + "no more bottles of beer." + eol\
  + "Go to the store and buy some more." + eol\
  + "99 bottles of beer on the wall.";
  return(lyrics)};

theLyrics = @workspace.lyrics99;

if not defined (theLyrics^) {
  new (wptextType, theLyrics)};

target.set (theLyrics);

wp.setText(ninetyNineBottles());

edit (theLyrics); Ťopen it in a window

window.zoom("workspace.lyrics99")
 
  © Oliver Schade <os@ls-la.net>, Generated: 06.06.2003 17:38:32