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 Cold Fusion

(UDF version)

Date:04/20/05
Author:S. Isaac Dealey
URL:n/a
Comments:2
Info:n/a
Score: (2.90 in 10 votes)
By S. Isaac Dealey

<cfscript>
   function beerSong(x) {
      b = iif(x gt 1, DE("bottles"), DE("bottle"));
      if (x) {
        WriteOutput("#x# #b# of beer on the wall...<br>#x# #b# of beer!</br>");
        WriteOutput("Take one down, pass it around...<br>";
        beerSong( x - 1 );
      }
      else
      {
        WriteOutput("No bottles of beer on the wall");
      }
   }
   beerSong(99);
</cfscript>

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
standard versionSteven Reich, Michael Dinowitz04/20/052
cfscriptS. Isaac Dealey04/20/051

Comments

>>  Al said on 02/25/07 07:16:49

Al ColdFusion is more properly written as one word, with the "F" capitalized.

>>  ES said on 04/11/07 16:31:33

ES Isaac, this doesn't have the right output... You are missing the fourth line of the verse. Also the third line of the verse has no close paren ";)".

Typical CF developer...

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: