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 Windows NT Batch

Date:09/24/05
Author:Frank-Peter Schultze
URL:http://www.fpschultze.de
Comments:0
Info:n/a
Score: (2.13 in 8 votes)
@Echo Off
SetLocal EnableDelayedExpansion
For /L %%A In (99,-1,0) Do (
  Set X=%%A
  If !X!==1 (Set B=bottle) Else (Set B=bottles)
  If !X!==0 Set X=No more
  Echo !X! !B! of beer on the wall, !X! !B! of beer.
  Set /A X -= 1
  If !X!==1 (Set B=bottle) Else (Set B=bottles)
  If !X!==0 Set X=no more
  If !X! GEQ 0 (
    Echo Take one down and pass it around, !X! !B! of beer on the wall.
  ) Else (
    Echo Go to the store and buy some more, 99 bottles of beer on the wall.
    )
  )
EndLocal

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
Uses 2000- and XP-specific featurestester08/18/050
2Kang Seonghoon (Tokigun)06/24/050

Comments

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: