Created
November 11, 2010 12:48
-
-
Save alterisian/672435 to your computer and use it in GitHub Desktop.
example of looping in groovy - similar to ruby I guess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3.times { | |
println it | |
} | |
println "---" | |
3.upto(9) { | |
println it | |
} | |
println "---" | |
3.step(9,3) { | |
println it | |
} | |
run in | |
grails console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment