I don't see why you would need any help, so how can I know how to help you? You could be a bit more specific about where you're having problems.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
ahm... my idea is having a 3 for loop the first loop will generate the 10 random numbers from 0-9 and the second loop will check if the number that was generated before is already in the array and it will check if the it is the last in the array,if it generate the second number and compare it to the first number and it check that it is the same it will generate again...i need a counter in this program but i dont know hoe to do the second loop im thingking of doing a while loop instead of for loop
Create an array holding the numbers 0-9
int array[]= {0,1,2,3,4,5,6,7,8,9}
Then randomly pick two index values and swap their contents.
Keep going until the array is sufficiently randomised, then print out the solution.
And this is the exact procedure used for deck shuffling programs to avoid rolling out a repeat. :rolleyes:
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439