Need help looping

I am writing a program and it works but I am using the following:
num1= rand() % 6 + 1;
num2=rand() % 6 +1;

but I have conditions that if num1& num2 are 1 then you get a score of zero but if my programs hits a 1 then it just keeps generating 1 again the same exact numbers for the player for like 1 sec or 2, then I gives new numbers. How can I keep this from happening? Everything else seems to work just fine.

note: I am also using a function separate from main and it is supposed to return a value being total. Num1 and Num2 are the ones that generated the total.

I'm guessing that you are not seeding your rand, if you don't seed then rand() will generate the same number every time.

srand (time(NULL));
closed account (3CXz8vqX)
Damn so that's what I was doing wrong... thanks Scorpic. (No I'm not michelle but I found your point just as useful as I had a similar problem).
Topic archived. No new replies allowed.