Language Candle
(plain text version)
| Date: | 11/17/11 |
| Author: | Henry Luo |
| URL: | http://candleapp.blogspot.com/ |
| Comments: | 0 |
| Info: | http://www.candlescript.org/ |
| Score: |
<?csp1.0?>
function nil:bottles($n as integer) {
if ($n == 1) { "1 bottle" }
else if ($n == 0) { "no more bottles" }
else { {$n + " bottles"} }
}
function main() {
for $b in reverse(0 to 99) {
{replace(nil:bottles($b), "n", "N")} " of beer on the wall, "
nil:bottles($b); " of beer.&cr;&lf;"
if ($b != 0) {
"Take one down and pass it around, "
nil:bottles($b - 1); " of beer on the wall.&cr;&lf;"
} else {
"Go to the store and buy some more, "
"99 bottles of beer on the wall.&cr;&lf;"
}
"&cr;&lf;"
}
}
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