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

428 B

title, localeTitle
title localeTitle
Create a JavaScript Slot Machine Crie um caça-níqueis JavaScript

Para isso, temos que gerar três números aleatórios usando a fórmula que eles nos dão e não o geral. 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;