Dice rolling functions using JavaScript