Random Permutations

I am at a loss. I have gotten some answers and I have tried looking it up but I cannot find exactly what I want to do. If someone has a link to share, that would be awesome. I have tried but either I can't figure out how to adjust code to do exactly what I want or I haven't found the right thing.

This is what I want to do:

Create every permutation of 6 numbers, 1-50. This is what it would look like:

1 1 1 1 1 1
1 1 1 1 1 2
1 1 1 1 1 3
1 1 1 1 1 4
...
45 45 45 45 45 45
45 45 45 45 45 46
45 45 45 45 45 47
...
49 49 49 49 49 49
49 49 49 49 49 50
49 49 49 49 50 49
49 49 49 49 50 50
...

I don't know if permutation is the correct word, but I hope this explains it well enough.

Thanks for any help!
Permutation is the correct word. And you can do this several ways. I'll link you to an old topic that maybe will help.
http://www.cplusplus.com/forum/beginner/102375/#msg550608
Well, it didn't help me write any code, but I can see why you linked it. I don't understand half of that code, though. I will look into it, though.

I haven't been able to think of how to apply methods I have looked up to my code because I don't quite understand it yet. I can see how the code in that thread works, sort of, but I also can't think of how to use it to help me because I don't know how to incorporate numbers 1- 50 instead of just one word or number.

Everything I've found does something like:

1234
1432
1243
1342.

So each of my 6 numbers will have to cycle from 1-50, creating every possible permutation.. :x

I'm sorry, I'm fairly new to programming. If anyone isn't interested in giving me any more hints, I am hoping more research will pay off. Thank you.
Last edited on
Topic archived. No new replies allowed.