Bulls and cows: Difference between revisions
m
→{{header|Kotlin}}
Line 4,182:
fun main() {
// generate a 4 digit random number from 1234 to 9876 with no zeros or repeated digits
val num: String =
.first { '0' !in it && it.toSet().size == 4 }
println("All guesses should have exactly 4 distinct digits excluding zero.")
|