songName.toMutableList().shuffle(Random())
It is shuffling, but toMutableList() creates new list which you then shuffle.
1 Like
I recommend to just write this:
val shuffledSongNames = songNames.shuffled()
It will create a new read-only list with already shuffled elements.
1 Like