src/js/main.js
// Laurens Holst @Stackoverflow - Fisher Yates Algorithm.
Laurens Holst @Stackoverflow - Fisher Yates Algorithm.
Laurens Holst @Stackoverflow - Fisher Yates Algorithm .
function shuffle(array) {
            let currentIndex = array.length,
                temporaryValue, randomIndex
            while (0 !== currentIndex) {
                randomIndex = Math.floor(Math.random() * currentIndex)
                currentIndex -= 1
                temporaryValue = array[currentIndex]
                array[currentIndex] = array[randomIndex]
                array[randomIndex] = temporaryValue
            }
            return array
        }
function shuffle ( array ) { let currentIndex = array . length , temporaryValue , randomIndex while ( 0 !== currentIndex ) { randomIndex = Math . floor ( Math . random ( ) * currentIndex ) currentIndex -= 1 temporaryValue = array [ currentIndex ] array [ currentIndex ] = array [ randomIndex ] array [ randomIndex ] = temporaryValue } return array }
Laurens Holst @Stackoverflow - Fisher Yates Algorithm.
Laurens Holst @Stackoverflow - Fisher Yates Algorithm .
// While there remain elements to shuffle... // Pick a remaining element... // And swap it with the current element.