' XBasic version of 99 Bottles of beer (Bottles.x)
' See http://www.xbasic.org/
' Philipp Winterberg, http://www.winterbergs.de
'
PROGRAM "99 Bottles of beer"
VERSION "1.0"
DECLARE FUNCTION Bottles ()
FUNCTION Bottles ()
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."
PRINT " "
NEXT b
END FUNCTION
END PROGRAM
;;; XLISP-PLUS version of 99 Bottles of beer (Bottles.lsp)
;;; http://www.aracnet.com/~tomalmy/xlisp.html
;;; Philipp Winterberg, http://www.winterbergs.de
(setq b 99)
(loop
(format t "~D bottle(s) of beer on the wall,~%" b)
(format t "~D bottle(s) of beer.~%" b)
(format t "Take one down, pass it around,~%")
(setq b (- b 1))
(format t "~D bottle(s) of beer on the wall.~%~%" b)
(when (= b 0) (return))
)
# XOTcl version of 99 Bottles of beer (Bottles.xotcl)
# http://www.xotcl.org
# Philipp Winterberg, http://www.winterbergs.de
for {set b 99} {$b > 0} {} {
puts "$b bottle(s) of beer on the wall,"
puts "$b bottle(s) of beer."
puts "take one down, pass it around,"
incr b -1
puts "$b bottle(s) of beer on the wall.\n"
}
\ XPLO version of 99 Bottles of beer (Bottles.xpl)
\ See http://www.idcomm.com/personal/lorenblaney/
\
\ Philipp Winterberg, http://www.winterbergs.de
code CRLF=9, INTOUT=11, TEXT=12;
integer B;
begin
B:= 99;
repeat
INTOUT(0, B); TEXT(0, " bottle(s) of beer on the wall,"); CRLF(0);
INTOUT(0, B); TEXT(0, " bottle(s) of beer."); CRLF(0);
TEXT(0, "Take one down, pass it around,"); CRLF(0);
B:= B - 1;
INTOUT(0, B); TEXT(0, " bottle(s) of beer on the wall."); CRLF(0);
CRLF(0)
until B = 0
end
<for
c1 = "XS version of 99 Bottles of beer (Bottles.xs)"
c2 = "Philipp Winterberg, http://www.winterbergs.de"
c3 = "See http://www.markcarter.me.uk/computing/xs.html"
var = "n" from = "99" to = "0" step = "-1">
<print>n, " bottle(s) of beer on the wall,\n", n,</print>
<print>" bottle(s) of beer.\nTake one down, and pass it around,\n",</print>
<print>n - 1, " bottle(s) of beer on the wall.\n"</print>
</for>
rem xScript version of 99 Bottles of beer (Bottles.xs)
rem See http://www.intelligent-data-systems.de/products/xccode.html
rem Philipp Winterberg, http://www.winterbergs.de
int b
string a,c,d,n
a = " bottle(s) of beer"
c = " on the wall"
d = "Take one down, pass it around,"
n = chr(13) + chr(10)
for b = 99 to 1 step -1
DisplayString cstr(b)+a+c+","+n+cstr(b)+a+"."+n+d+n+cstr(b-1)+a+c+"."
next