<div class="htmlarea"><textarea id="runcode60718"> <title>JavaScript随机排序</title> <script> var h=["红桃","方片","黑桃","梅花"],l=[2,3,4,5,6,7,8,9,10,"J","Q","K","A"],p=[],q=[],i; for(i=0;i<53;i++)q[p[i]=Math.random()]=i; p.sort(); for(i=0;i<53;i++)document.write(h[q[p[i]]%4]+" "+l[(q[p[i]]/4|0)%13]+"<br>"); </script> </textarea></div>