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 DM

(Sing-along!)

Date:10/27/07
Author:Hiead
URL:n/a
Comments:1
Info:http://byond.com
Score: (2.89 in 9 votes)
var/const
	linePause = 12
	endLinePause = 17
	endVersePause = linePause + endLinePause

client/New()
	..()
	var/bottleCt = 99
	var/bottleRef = "99 bottles"
	
	do
		src << "[bottleRef] of beer on the wall,\..."
		sleep(linePause)
		src << " [bottleRef] of <em>beer</em>."
		sleep(endLinePause)
		src << "Take one down and pass it around,\..."
		
		--bottleCt
		if(bottleCt == 0)
			bottleRef = "no more bottles"
		else if(bottleCt == 1)
			bottleRef = "1 bottle"
		else
			bottleRef = "[bottleCt] bottles"
			
		sleep(linePause)
		src << " [bottleRef] of beer on the wall.\n"
		sleep(endVersePause)
	while(bottleCt)
	
	src << "No more bottles of beer on the wall,\..."
	sleep(linePause)
	src << " no more bottles of <em>beer</em>."
	sleep(endLinePause)
	src << "Go to the store and buy some more,\..."
	sleep(linePause)
	src << " 99 bottles of beer on the wall."

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
Upgraded version of DanTom'sMechana241209/22/076

Comments

>>  JT said on 08/26/08 19:59:21

JT This block:

else if(bottleCt == 1)
bottleRef = "1 bottle"
else
bottleRef = "[bottleCt] bottles"

could be simplified to:

else
bottleRef = "[bottleCt] bottle\s"

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: