Randomized list

I made a USB driven button with a Teensy that will send you to random pre-assigned web pages (below), but what I really want is for it to run through a whole randomized list of web pages, re-randomize the list, and repeat. Can someone please suggest the best way to do this? :slight_smile:

Current method:
const byte NUMBER_OF_PAGES = 35;
char* names[NUMBER_OF_PAGES] = { LIST of 35 };

if(digitalRead(0)==LOW){
Keyboard.print(names[random(0,NUMBER_OF_PAGES)]);
}

Declare an array of 35 bytes
initialize all of them to 255
loop from 0 to 34
use the random function to pick a number from 0 to 34
if array[RandomNumber] == 255
set that cell to loop counter
else
increment through the array until you find an unused element to put loop counter in, remembering that you may need to circle back to the start of the array

Now you have an array of random numbers you can use to index into your web address array