Randomization shouldn't be that hard. An order N algorithm is provably random. Here's one a friend of mine coded up...it takes a pointer to a list of integers and the size of the list, then builds that list and shuffles it. You should never need to shuffle more than once. I have not included a proof. ;)
void shuffled_ramp(int *pos, int size)
{
/* build a ramp, for shuffling */
for (int i = 0; i < size; i++)
pos = i;
for (int i = 0; i < size; i++)
{
int r = random() % (size - i);
int tmp = pos;
pos = pos[r + i];
pos[r + i] = tmp;
}
}
I encourage you to try it out. And if this shows up as preformatted, I don't know why, as I've included an end tag..
Fly me to the moon...