lundi 13 août 2018

Pseudo-random algorithm

I would like to create a pseudo-random algorithm on a sequence. The sequence would look like : A B C D E F A B C D E F A B C D E F A B C D E F... The algorithm shall aim to create a shorter random sequence of these letters, the rules being : - never to identical letters fillowing each other (i.e A A B C D) this one is quite easy, troubles come after : - dyads can be repeated only twice ( A B A B A C B D is ok but A B C D A B A B is not) - tryads should never be repeated ( A B C D A B C not ok). I am not really good at algorithms and I have tried to make this one work for a long time but did not manage, so i hope you can help me !




Aucun commentaire:

Enregistrer un commentaire