Language groovy
| Date: | 08/14/05 |
| Author: | Akihito Tsukamoto |
| URL: | n/a |
| Comments: | 2 |
| Info: | http://groovy.codehaus.org/ |
| Score: |
def bottlesOfBeer(n) {
return "" + (n==0 ? "no more" : n) + (n==1 ? " bottle" : " bottles") + " of beer";
}
99.downto(1) {
println bottlesOfBeer(it)+" on the wall, " + bottlesOfBeer(it) + "!"
println "Take one down, pass it around,"
println bottlesOfBeer(it-1)+" on the wall!"
println ""
}
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