Language BlitzMax
(Uses some BlitzMax advaantages)
Date: | 05/25/07 |
Author: | Nicholas Kingsley |
URL: | http://www.nicholaskingsley.co.uk |
Comments: | 4 |
Info: | http://www.blitzmax.com |
Score: | ![]() |
' This takes advantages of some BlitzMax features - auto conversion of integers ' to strings, for example. Strict Local t$ Local bottles:Int 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)+" of beer on the wall"+Chr(10) Else Print "No more bottles of beer on the wall"+Chr(10) EndIf Next 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..." End Function isPlural:String(bottles:Int) Local temp$ temp$=bottles+" bottle" If bottles>1 temp$=temp$+"s" EndIf Return temp$ EndFunction
Download Source | Write Comment
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!
Comments