nbDes= Number of Dices that need to be displayed
affichageDes=Code to display it in the HTML
tDes= table from 1 to 12, each of them given the value of a dice (it's a .gif). 1 to 6 = red dice , 7 to 12 = blue dice.
rand1= random equation to get a dice from 1 to 6 (red dices only)
Code
if(rouge==true){
for(i=0;i<nbDes;i++){
affichageDes+=tDes[rand1];
My problem is: My loop works, if I select 3 red dices, there's 3 red dices
. The only thing that don't work is that they're all the same. They randomize, but they'll always be the same number. Example: I want 5 dices, I'll have 5, but they'll all be on the #2 side. Whenever I load the page back, they'll be any number from 1 to 6, but never 2 dices will be different. I need random numbers for each dice. I know it's probably an easy fix, I'm all new to this and somehow it's been bugging me for awhile now. How do I fix this?