Oh wow this is great! thanks so much! Hmmm alright I think I see what you did...You used the time function to make it so the dice roll is random EVERY time, and not just the first time. Would you mind explaining how that gets incorporated into the program? Also yeah these loops do seem much more efficient!

here is some pre-requisite knowledge:rand() is a psuedo-random number generator, meaning it acts like a real rng but isn't as it is calculated with a formula (google to know more).

the srand() function provides a seed to the rand() function where time(NULL) is the seed (NULL just means you're not storing the time in memory). time(NULL) is an integer which is calculated in seconds since a specific date and time (google to know more) which is then provided to seed. once srand() has this, it will seed the rand() function each time it is called and since time is dynamic, it changes every time (meaning within the range of one second), otherwise, as you may have witnessed in your program, it will output the same numbers each time as rand() without a seed is automatically seeded by a static integer of 1.

Alright yeah thanks so much! I think I get it, but just to clarrify...ok so I understand the point of the time function and srand and all that. So, when you use srand(time(NULL)) it changes any other rand() function thereafter for the program? Sorry if worded that very weirdly lol. And @Nishant Tadiv, I'm not sure what you're telling me?