Nice job on the non-repeating random numbers in Swift 4.2!

let sequence = 1 ..< 27
        let shuffledSequence = sequence.shuffled()
        print (shuffledSequence)


Wow now it is so easy! Two lines of code. No more shuffling arrays, or writing C scripts.


For me, Non-repeating random numbers are the basis of all my games.


From chess puzzles to map making. Finally, an easy solution.


Thannks for the update.

Nice to read a totally enthusiastic comment!


Don't forget to answer yourself and mark your own answer as correct, to close the thread.

I don't think they're non-repeating. They'll repeat eventually (but you may have to wait a LONG time).

Nice job on the non-repeating random numbers in Swift 4.2!
 
 
Q