Last active
December 14, 2015 13:48
-
-
Save mike-neck/5095866 to your computer and use it in GitHub Desktop.
たしかにhelloが出力される
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
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