Skip to content

Instantly share code, notes, and snippets.

@rssh
Created April 11, 2018 20:31
Show Gist options
  • Save rssh/bfd3bc550ef33502641a783e545d9697 to your computer and use it in GitHub Desktop.
Save rssh/bfd3bc550ef33502641a783e545d9697 to your computer and use it in GitHub Desktop.
Winner of SalaDays tickets Raffle
package X
import scala.util.Random
object ScalaDaysRaffle
{
val participants = Seq(
"Andrey Parhomenko" -> "http://github.com/team3",
"Yurii Khomenko" -> "https://github.com/yurii-khomenko",
"Victor Moskvych" -> "https://github.com/wouzar",
"Anastasiia Kharchenko" -> "",
"Artur Zhurat" -> "https://github.com/azhur",
"Victor Vasiliv" -> "https://github.com/Vict0rynox"
)
val extraSalt=0 // last number in comments for FB post before 00:00:00 Apr. 12 if will be any
val seed = participants.map(_._2.size).sum + extraSalt
def main(args:Array[String]):Unit = {
val random = new Random(seed)
val i = random.nextInt(participants.size)
System.out.println(s"$i:${participants(i)}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment