Skip to content

Instantly share code, notes, and snippets.

@xnrghzjh
Created July 7, 2011 07:36
Show Gist options
  • Save xnrghzjh/1069048 to your computer and use it in GitHub Desktop.
Save xnrghzjh/1069048 to your computer and use it in GitHub Desktop.
Groovyで色んなHelloWorld
// タイプ
"Hello World.".each() {print it; sleep(it==" "? 500:100);}
// Robot
r = { new java.awt.Robot().keyPress(it);sleep(100)}; l=[47,47,72,69,76,76,79,32,87,79,82,76,68] ;l.each(){r(it)}
// マップ withDefault()使用
m=['h':'H','w':' W','k':'ld'].withDefault{it};doWork={it.split("\\.")[1].each(){print m[it]}}; doWork('https://www.hellowork.go.jp/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment