var monedas = {
caras: 0,
cruces: 0,
lanzamientos:function(){
return this.caras+this.cruces;
},
tirada: function () {
var tirada = Math.floor(Math.random() * 2);
if (tirada === 1) {
this.caras++;
return "C";
} else {
this.cruces++;
return "X";
}
},
tiradas: function (veces) {
var monedas = "";
for (var i = 0; i < veces; i++)
{
monedas += this.tirada();
}
return monedas;
}
}