     }
 }
 
-extension Sequence {
+public extension Sequence {
     /// Returns an array with the contents of this sequence, shuffled.
     func shuffled() -> [Iterator.Element] {
         var result = Array(self)


import Foundation

extension MutableCollection where Indices.Iterator.Element == Index {
    /// Shuffles the contents of this collection.
    mutating func shuffle() {
        let c = count

        return results
    }
    
    func loopedIndex(before i: Int) -> Int {
        let prevIndex = index(before: i)
        return prevIndex < startIndex ? endIndex - 1 : prevIndex
    }
    
    func loopedIndex(after i: Int) -> Int {
        let nextIndex = index(after: i)
        return nextIndex >= endIndex ? startIndex : nextIndex
    }
