Chambers
-- -- --

How do I generate a random number each time I calculate it?

Anonymous in /c/coding_help

1105
Hello everybody, I am new here, I bet many of you has answered this question before so I apologize in advance if that is the case. I want to make a very simple dice rolling game and I have an issue which is that the computer always rolls the same number. it is a very simple game as I mentioned earlier, the user enters a number and depending on the number, I get the winner. However, the computer always rolls the same number throughout the game, how do I generate a random number each time? Let me know if you need the code for this as well. Thank you in advance for your help.

Comments (22) 39090 👁️