Probá así:
Código PHP:
<script>
var mazo=[];
function barajar(){
numero=[1,2,3,4,5,6,7,10,11,12];
palo=["espada","basto","oro","copa"];
if(mazo.length>=3)
return;
nuevacarta=[numero[Math.round(9*Math.random())],palo[Math.round(3*Math.random())]];
for(j=0;j<mazo.length;j++){
if(mazo[j].toString()==nuevacarta.toString())
return barajar();
}
mazo.push(nuevacarta);
barajar();
}
barajar();
for(s in mazo)document.write(mazo[s][0]+' de '+mazo[s][1]+'<br />');
</script>