milsaware / javascript-roulette

Fully functioning roulette game made in Javascript and CSS
https://ozboware.github.io/javascript-roulette/
GNU General Public License v3.0
66 stars 39 forks source link

Bug Fix: Make number generator go from 0 to 36 #2

Closed ghost-writer-727 closed 11 months ago

ghost-writer-727 commented 11 months ago

Math.random() gives you a random decimal between 0 and 1, not including 1. Multiply it by 37 to expand the range: Now it's a decimal between 0 and 37, not including 37. Math.floor() rounds down to the nearest whole number, so you get a whole number between 0 and 36.

vercel[bot] commented 11 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
javascript-roulette ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 1:44pm