Files
freeCodeCamp/guide/spanish/javascript/tutorials/create-a-javascript-slot-machine/index.md
2018-10-16 21:32:40 +05:30

434 B

title, localeTitle
title localeTitle
Create a JavaScript Slot Machine Crear una máquina tragamonedas JavaScript

Para esto tenemos que generar tres números aleatorios usando la fórmula que nos dan y no la general. Math.floor(Math.random() * (3 - 1 + 1)) + 1;

slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1; 
 slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1; 
 slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;