How to choose a random element from an array in Scala?
import scala.util.Random
val A = Array("please", "help", "me")
Random.shuffle(A.toList).head
import scala.util.Random
val A = List(1, 2, 3, 4, 5, 6)
A(Random.nextInt(A.size))
import scala.util.Random
val A = Array("please", "help", "me")
Random.shuffle(A.toList).head
import scala.util.Random
val A = List(1, 2, 3, 4, 5, 6)
A(Random.nextInt(A.size))