Use Math.floor()
when working with random numbers.
Math.rand()
returns a number between zero and one, but zero is included while one is not.
If you multiply by 10, then zero is included but 10 is not.
This means that if you round up, you will never* get 0
as a result.
So, round it down ;)
*In order to get zero, the randomly-chosen number must itself be exactly zero. Mathematically, the odds of picking any exact real number in a range of real numbers is zero, however in practice, due to the limitations of numbers in computing, it's much more possible but still ridiculously unlikely.