Created
June 24, 2012 04:37
-
-
Save nemo-kaz/2981644 to your computer and use it in GitHub Desktop.
dentaku 電卓
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
#!/usr/bin/groovy | |
import groovy.util.Eval | |
if (args.length ==0) { | |
println """Groovy電卓 使用例: dentaku 1+2*3 | |
第一引数に 計算式をスペース無しで指定してください""" | |
return | |
} | |
def eval = new Eval() | |
println eval.me(args[0]) | |
// 動作イメージ | |
// >dentaku.groovy 1+2*3 | |
// >7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment