Created
July 9, 2010 06:19
-
-
Save brianhsu/469128 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Port from http://gist.github.com/469067 | |
| import scala.util.Random.shuffle | |
| import scala.math.random | |
| def randomNickname = { | |
| def howlong = ((random * 10) % 3 + 2).toInt | |
| shuffle("日月天地風雷雨古龍金庸鳥山明".toList).take (howlong).mkString + | |
| shuffle("君臣妺子".toList).head | |
| } | |
| /* | |
| 雨天臣 | |
| 雷雨月明妺 | |
| 日月子 | |
| 地古子 | |
| 雨雷臣 | |
| 月山妺 | |
| 庸龍風月君 | |
| 鳥風明地君 | |
| 鳥古妺 | |
| 龍古臣 | |
| */ | |
| for (i <- 1 to 10) { | |
| println (randomNickname) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment