Do while loop freezes

grrr, k, this is probably too simple, but I just can’t get around it and here’s what I want to do:

I have an array with let’s say 10 items (keuzes_arr) in it and I want to put 'm on stage randomly, but every item can only be placed once. So I created a little loop, but for some reason the loop freezes constantly.

This loop creates a random number, checks if it’s already been used. And if not it use it to place the item on the stage.


do {
            randomNum = Math.round(Math.random() * (keuzes_arr.length - 1));
            for (j=0; j < randomNum_arr.length; j++) {
                if (randomNum_arr[j] == randomNum) {
                    randomCheck = true;
                    break;
                }
            }
        } while (randomCheck);

Note: this loop is already in another for-loop, so maybe it’s just too much looping … but I don’t see any other way to pull this off.