shuffle = -> for x in [0..VA.length] VA.swap x, Math.floor(Math.random()*VA.length) sort = -> VA.play() if !checkSorted() shuffle() setTimeout(sort, 10) checkSorted = -> for x in [0..VA.length-1] if VA.gte(x, x+1) return false return true sort()