Home

Roll the dice

dice 5dice 2dice 2

5 + 2 + 2 = 9


const e=document.querySelector("main button");e.addEventListener("click",(function(e){let t="",c="",n=0;for(let e=0;e<3;e++){const e=Math.floor(6*Math.random()+1);n+=e,c+=e+" + ",t+=`<img src="/assets/dices/dice${e}.svg" alt="dice ${e}">`}c=`${c.slice(0,-2)} = ${n}`,document.querySelector("main figure").innerHTML=`${t}<figcaption><h4>${c}</h4></figcaption>`})),e.dispatchEvent(new Event("click"));
//# sourceMappingURL=dice.js.map