Answers for "check random numbers to apear only once kotlin"

0

check random numbers to apear only once kotlin

val unpickedNumbers = (0..75).toMutableSet()

nextnumberbutton.setOnClickListener {
    if (unpickedNumbers.isEmpty()) {
        Toast.makeText(context, "All numbers already picked", Toast.LENGTH_LONG).show()
        return
    }
    val rand = unpickedNumbers.random()
    numbertextview.text = rand.toString()
    unpickedNumbers.remove(rand)
}
Posted by: Guest on March-25-2022

Code answers related to "check random numbers to apear only once kotlin"

Browse Popular Code Answers by Language