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 PowerBatch

(I must have been bored.)

Date:09/27/05
Author:Christopher Mathews
URL:n/a
Comments:0
Info:http://ourworld.compuserve.com/homepages/Joel_Harper_CSD/PBHome.htm
Score: (2.93 in 15 votes)
Variable  lvBeers,100                          
Variable  lvBeersOnWall,30
Variable  lvEndBeers,30
Variable  lvCount,3
Variable  lvTakeOne,100
Variable  lvTake,100
Variable  lvLength,3
Variable  lvFinalTake,100
Variable  lvOneBottle,100
SetVar    lvBeers,99
SetVar    lvTake,99
SetVar    lvCount,99
SetVar    lvBeersOnWall," bottles of beer on the wall, "
SetVar    lvOneBottle," bottle of beer on the wall, "
SetVar    lvTakeOne, "Take one down and pass it around, "
Label     MainLoop 
Concat    lvBeers,lvBeersOnWall                             
Subtract  lvTake,1
Concat    lvTake,lvBeersOnWall
Concat    lvTakeOne,lvTake
MidString lvEndBeers,lvBeers,1,18
Concat    lvBeers,lvEndBeers
WriteLine lvBeers
Length    lvLength,lvTakeOne
Subtract  lvLength,2
MidString lvFinalTake,lvTakeOne,1,lvLength
WriteLine lvFinalTake
Subtract  lvCount,1
SetVar    lvTake,lvCount
SetVar    lvBeers,lvCount
SetVar    lvTakeOne,"Take one down and pass it around, "
Compare   lvCount,1,MainLoop,OneBeer
Label     OneBeer
Concat    lvBeers,lvOneBottle
MidString lvEndBeers,lvBeers,1,17
Concat    lvBeers,lvEndBeers
WriteLine lvBeers
Concat    lvTakeOne,"No more bottle of beer on the wall"
WriteLine lvTakeOne
WriteLine "No more bottle of beer on the wall, no more bottles of beer."
WriteLine "Go to the store and buy some more, 99 bottles of beer on the wall."

Download Source | Write Comment

Alternative Versions

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: