Randomization / Random Generator

Heya!!

I am really new here, and thus it's my first post. Let me know if there's any problem regarding this post, and I'll either delete it, move it or edit it. :D

I am currently taking Computer Science at university (and our programme is Visual Studio 2005). We are assigned to do an assignment where we have to type 20 phrases (can be poems, quotes, or whatever) in the coding, so only 8 RANDOM phrases (out of these 20 phrases) will be shown on the output. Once you're done with all of the codes, you press F5 many times to see the output/code run, they will show you 8 random phrases. I hope that makes sense. I am done with that. However, there's a small task that we are asked to do. Each phrase outputted each time the code runs cannot be said in the 2 previous times as well as it cannot be said in the next two times. I wonder if any of you know the code/hint to help me come up with the solution to do this?

Any help would be appreciated! Thanks in advance.
Does not make since. Your saying each time the program runs it cannot display what the previous 2 runs displayed? If thats the case you would run out of phrases on the 3rd run.
1st run 8
2nd run different 8
3rd run, only 4 left.
No no, that's not what I meant. Ok I'll give you an instance to make it easier - as I know it's so hard to explain it here.

So you put 20 phrases in the code:

0) asfdadf
1) sfjas ffd
2) afdlaj df
... and so on up to 19 (which are 20 phrases in total)

And you use the randomization code that takes 8 RANDOM phrases out of these 20 phrases in the coding, to be shown on the output. And each time the code runs, 8 phrases will show, but some of them will be the same as the previous time the code ran, while some of the other phrases will be different. So what I am being asked to do is to come up with the solution to make each phrase not being repeated twice in the previous times as well as in the next two times. That means any phrase in the output will not be repeated if you run the code two times, so that means another phrase that has not been in the output for a while, has to be shown in the output. Get my drift?
What binarybob said still applies.
If you run the program twice, 16 different phrases will be displayed.
In the third run it still can't use any of the previous 16 phrases (so you said), so only 4 are left, but it has to display 8.
Topic archived. No new replies allowed.