Skip to content

Instantly share code, notes, and snippets.

@le0nidas
Created December 16, 2020 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save le0nidas/b9b8fcbdefdf39bf74aa4542ed8d6233 to your computer and use it in GitHub Desktop.
Save le0nidas/b9b8fcbdefdf39bf74aa4542ed8d6233 to your computer and use it in GitHub Desktop.
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