摘要:
//快速排序function quicksort(seq) { if (seq.length > 1) { var k = seq[0]; var x = []; var y = []; for (var i=1,len = seq.length; i<len; i++) { if (seq[i] <= k) { x.push(seq[i]); } else { y.push(seq[i]); } } x = quicksort(x); y = quicksort(y); ret... 阅读全文
摘要:
function getRandomPlayCard(m){ var arr=new Array(m); for(var i=0;i<m;i++){ var rnd=Math.floor(Math.random()*(i+0.99999)) arr[i]=arr[rnd]; arr[rnd]=i; } return arr;}; 阅读全文