Skip to content

Instantly share code, notes, and snippets.

@mike-neck
Last active December 14, 2015 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-neck/5095866 to your computer and use it in GitHub Desktop.
Save mike-neck/5095866 to your computer and use it in GitHub Desktop.
たしかにhelloが出力される
def randomString = {long seed ->
def random = new Random(seed)
def chars = []
while(true) {
def c = random.nextInt(27)
if (c == 0) break
else chars << ((96 + c) as char)
}
return chars.join('')
}
def string = randomString(-229985452)
println string
assert string == 'hello'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment