Random number without repetition

Hi everybody, how can I generete a system in which every time I choose a random number from a range of numbers i get always a new one, without repetition.
In my game i’ve set 10 power ups. Each power up lasts for the entire game. The more the score increases, the more power ups i get (they work simultaneously).
I’ve tried to use arrays/structures but i can’t understand how can i get a value included in it refferring to the index.
The only solution I found is repeating the choice of the number (PowerUp) until i get one that hasn’t come out yet.

An array sounds exactly what you want here. Here’s a previous solution

1 Like