Skip to content

Instantly share code, notes, and snippets.

@marcgeld
Last active June 13, 2017 20:03
Show Gist options
  • Save marcgeld/4f2fe87be7ac78e507f8babd1e74c6b9 to your computer and use it in GitHub Desktop.
Save marcgeld/4f2fe87be7ac78e507f8babd1e74c6b9 to your computer and use it in GitHub Desktop.
Groovy scanner
#!/usr/bin/env groovy
print "enter number: "
System.in.eachLine() { line ->
n = line.trim().toInteger()
(1..10).each{
int res = n * it
println "${n} x ${it} = ${res}"
}
print "enter a new number: "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment