I want to generate strings of length N, draw from a set of M chars, but with no more than two of any given char consecutively.
Examples:
set ABCDEF; length 12; Valid: ABCDEFABCDEF AABBCCDDEEFF Invalid: AAABCDEFABCD
I don't know whether this is tougher than it first appears, or I'm just having a bad head day. but my attempts so far involve cumbersome loops with the setting and resetting of myriad flags.
Any thoughts on a clean way to do this?
In reply to Random data generation. by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |