Skip to content

Instantly share code, notes, and snippets.

@fomkin
Created December 13, 2017 11:37
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 fomkin/ede274cdb82cc1934178b532bf852eaa to your computer and use it in GitHub Desktop.
Save fomkin/ede274cdb82cc1934178b532bf852eaa to your computer and use it in GitHub Desktop.
val users = Vector(
"@demyanam1",
"@CipHuK",
"@sergey_samoylov",
"@ermakovolegs",
"@wouzar",
"@_sashashakun",
"@myBloodyScala",
"@lmnet89",
"@laughedelic",
"@noviiden",
"@AlexTyth",
"@danich3g",
"@yelbota",
"@ledostuff",
"@antonshwab",
"@titantins",
"@headstorn",
"@andreyshikov"
)
val random = new scala.util.Random(users.hashCode)
Seq
.fill(users.length)(random.nextInt(users.length))
.distinct
.map(users.apply)
.zipWithIndex
.foreach {
case (name, index) =>
println(s"${index + 1}. $name")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment