Repeating Contextual Alternates more Randomly

Hi,
I’ve been testing and googling for a while now, but I can’t get this work.
I’m working on an experimental type project. What I’m trying to do is to repeat a character in a random way.

I have following 5 characters:
zero, zero.001, zero.002, zero.003, zero.004, zero.005

Currently I am using this code to repeat them, when they are typed after each other:

lookup rotate {
sub zero zero’ by zero.001 ;
sub zero.001 zero’ by zero.002 ;
sub zero.002 zero’ by zero.003 ;
sub zero.003 zero’ by zero.004 ;
sub zero.004 zero’ by zero.005 ;
sub zero.005 zero’ by zero ;
}rotate;
lookup rotate;


Here is an image of how it looks like now (the worm poops are the character “zero, zero.001… zero.005”), but I would like to repeat them differently for the second, third and fourth loop, so that the repeat pattern can not be recognized easily.

Are there any hints, on how to loop them more randomly?

Hard if you keep it all as an alternative of one single glyph. Read this: http://www.glyphsapp.com/tutorials/features-part-3-advanced-contextual-alternates/

Btw the above example should work with just these lines:
sub zero zero’ by zero.001 ;
sub zero.001 zero’ by zero.002 ;
sub zero.002 zero’ by zero.003 ;
sub zero.003 zero’ by zero.004 ;
sub zero.004 zero’ by zero.005 ;

To explain the code in the tutorial: it effectively takes the user input as randomizer. If you don’t just take zero, but perhaps also period, degree, o and O for the calt loop, then you could have more variation to begin with, and use the looping code from the tutorial to build on that.