Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val animals = listOf("Lion", "Penguin", "Giraffe", "Whale", "Shark")
val usernames = animals.map { animalAsBase ->
val randomNumber = Random.nextInt(0, 10)
val randomCharacter = listOf("!", "@", "$", "%", "#")[Random.nextInt(0, 5)]
"$animalAsBase$randomCharacter$randomNumber"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment