程式码如下:
var random = new Array();
random[0] = Math.floor(Math.random()*10);
random[1] = Math.floor(Math.random()*10);
random[2] = Math.floor(Math.random()*10);
random[3] = Math.floor(Math.random()*10);
random[4] = Math.floor(Math.random()*10);
random[5] = Math.floor(Math.random()*10);
random[6] = Math.floor(Math.random()*10);
random[7] = Math.floor(Math.random()*10);
random[8] = Math.floor(Math.random()*10);
random[9] = Math.floor(Math.random()*10);
for(var i = 0 ; i < 10 ; i++){
if(random[i] == random[i+1]){
random[i+1] = Math.floor(Math.random()*10);
i