I'm a C++ beginner but I'm going to try talking this out.
Okay so let's say the user picks 1,2,3,4,5.
First =1, Second =2, etc.
Then what you want to do is compare each picked number with a set of random numbers.
I believe the way that you have your j loop set up, even if you were to compare the picked numbers, x would constantly change value.
I think you need to create an array of integers for random numbers, that way the set will stay constant so you can compare each number.
int randomnumberarray[5].
Then
1 2
|
for (int j = 0; j < 5; j++)
randomnumberarray[j] = rand() % 5+1
|
;
I'm not sure whether or not this particular syntax is valid.
This way randomnumberarray[0], randomnumberarray[1], etc are assigned values.
Then I think you can use either if statements or for loops to compare the picked numbers with the random numbers.
And if they are the same number then keep a count of it.
Then you can use the count to multiple their initial bet.
so have like
int betcount =0;
Perhaps something like
1 2 3 4 5 6
|
if (first == randomnumberarry[0] || first == randomnumberarray[1] || etc)
betcount++
else
if (second == randomnumberarray[0] || second == randomnumberarray[1] etc)
betcount++
etc.
|
This may work but I'm just doing a lot of hand waving.