I am using a knuth shuffle to randomise an array. I would like to be able to add another array and have it randomise in the same way. I had previously thought of separating the array within the string, such as ['A|1|I,B|2|II,C|3|III,D|4|IV'] etc.
On stackoverflow, I read this but I can't work out how to arrange it for a knuth shuffle.
This is the JS I am using at the moment to get a string from the first array, with additional code taken from the link above.
Array.prototype.knuthShuffle = function()
        {
            var i = this.length, j, temp;
            while ( --i )
            {
                j = Math.floor( Math.random() * (i - 1) );
                temp = this[i];
                this[i] = this[j];
                this[j] = temp;
            }
        };
var array_chromatic = ['A', 'A%23', 'Bb', 'B', 'C', 'C%23', 'Db', 'D', 'D%23', 'Eb', 'E', 'F', 'F%23', 'Gb', 'G', 'G%23', 'Ab'],
    array_chronumb = ['Aa', 'A%23a', 'Bbb', 'Bb', 'Cc', 'C%23c', 'Dbd', 'Dd', 'D%23d', 'Ebe', 'Ee', 'Ff', 'F%23f', 'Gbg', 'Gg', 'G%23g', 'Aba'];
        function renderKnuth()
        {
            array_chromatic.knuthShuffle();
      array_chronumb.knuthShuffle();
            var audio = document.getElementById('sound');
      audio.src = 'url-redacted' + array_chromatic[0] + '.mp3';
      var str1 = array_chromatic[0]
      str2 = str1.replace("%23", '#');
            document.getElementById('knuth_data2').innerHTML = str2;// + array_accidental[0];
document.getElementById('knuth_data3').innerHTML = array_chronumb[0];
        }
 
     
     
    