Randomization without double or triple repeats

Have a look at a couple of my online demos in PsychoPy Online Demos

Randomisation without repetition and Complex Randomisation may give you some pointers.