|
Posted by John on 07/22/05 10:49
mark wrote:
> I have 4 colors, red, blue, yellow, green in an array. I wish to display 3
> of them on a page at ramdon without repeating one on the same page. So,
> refresh = yellow, green, blue | refresh = red, blue, yellow.....etc etc...
>
> Can someone point me in the direction of the function I should be looking to
> us to use to stop two colors appearing twice?
>
>
The colours can be given indexes 0, 1, 2, 3. You simply have to decide
which index you DON'T want to display.
Generate a random number between 0 and 3 (inclusive) and then don't
display the colour with that index.
John
Navigation:
[Reply to this message]
|