1 function random_card(){
2 if(cards.length > 0){
3 var rand = Math.floor(Math.random()*cards.length);
4 var html = "card: <img src='./img/"+cards[rand][0]+"' /><br/>points: "+cards[rand] [1]+"<br/><br/>";
5 document.getElementById("myDiv").innerHTML += html;
6 cards.splice(rand, 1);
7 }
8 }
9
1var cards = new Array(
2 new Array("manzana.jpg", 1),
3 new Array("manzana.jpg", 2),
4 new Array("manzana.jpg", 3),
5 new Array("pera.jpg", 1),
6 new Array("pera.jpg", 2),
7 new Array("pera.jpg", 3),
8 new Array("melon.jpg", 1),
9 new Array("melon.jpg", 2),
10 new Array("melon.jpg", 3)
11);
12