Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language DarkBasic

Date:04/20/05
Author:Philipp Winterberg
URL:http://www.winterbergs.de/
Comments:7
Info:http://www.darkbasic.com/download.php
Score: (2.40 in 48 votes)
rem DarkBasic version of 99 Bottles of beer (Bottles.dba)
rem http://www.darkbasic.com/download.php
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$, "."
  wait (1000) : cls rgb(0,0,0)
next b : end

Download Source | Write Comment

Alternative Versions

Comments

>>  MR DB said on 08/29/05 11:02:01

MR DB Added an internal DarkBasic check:

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$, "."
wait (1000) : cls rgb(0,0,0)
BUG=RAND(1000)
IF BUG>2 SHOW MESSAGE "UNKNOWN ERROR!"
next b : end

>>  Nicholas Kingsley said on 09/20/05 14:23:01

Nicholas Kingsley Bit stupid adding the extra bits...

>>  moldrat said on 09/24/05 03:47:01

moldrat wtf?

"BUG=RAND(1000)
IF BUG>2 SHOW MESSAGE "UNKNOWN ERROR!""

lol noob

>>  Nicholas Kingsley said on 09/27/05 15:52:15

Nicholas Kingsley One for DBPro (seeing as it wasn't added through the submit new language way) :

global t$ as string

for bottles=99 to 1 step -1
t$=isPlural(bottles)

t$=t$+" of beer on the wall"

print t$;", ";t$
print "Take one down and pass it around, ";

if bottles-1>0
print isPlural(bottles-1);
print " of beer on the wall"
else
print "No more bottles of beer on the wall"
endif
sync
next bottles

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..."
wait key
end

function isPlural(bottles as integer)
local temp$ as string

temp$=str$(bottles)+" bottle"
if bottles>1
temp$=temp$+"s"
endif
endfunction temp$

>>  King6m said on 12/14/07 17:32:44

King6m just another way to do it:
with the do loop function.
Code:
beer = 99
Do
if beer = 0 then exit
if beer > 1
print beer+" bottles of beer on the wall"
Print beer+" bottles of beer"
else
print beer+" bottle of beer on the wall"
Print beer+" bottle of beer"
endif
print "take one down pass it arrount"
wait 2000
beer = beer - 1
cls
loop
cls
print "And that's the end of the song"

>>  hierojpk said on 03/22/09 13:12:21

hierojpk REM 99 BOTTLES OF BEER ON THE WALL!
sync on:sync rate 0:hide mouse
alc=99:time=210
do
time=time-1
if time<0 then time=210:dec alc, 1:cls: print "YOU TAKE ONE DOWN AND PASS IT AROUND!!!":wait 1000
cls:set cursor rnd(3)+1,rnd(3)+1
if time>0 then cls:print alc,"BOTTLES OF BEER ON THE WALL!!!"
sync
loop

>>  barrym said on 03/29/10 06:07:19

barrym More lazy-ass "bottle(s)" code. C'mon Phil, give us a conditional
expression or two. Geez Louise..........

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: