Assigning a random attribute at a random actor

Good morning GS,

I would like to have one of four colours assigned to four different actors every 3 seconds where no 2 actors have the same colour. Does anyone have any suggestions or pointers in the right direction? Many thanks in advance

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881

    There are 24 permutations of the combination 1,2,3,4:

    1234,
    1243,
    1324,
    1342,
    1423,
    1432,
    2134,
    2143,
    2314,
    2341,
    2413,
    2431,
    3214,
    3241,
    3124,
    3142,
    3421,
    3412,
    4231,
    4213,
    4321,
    4312,
    4123,
    4132

    I would suggest putting them into a 4x24 table and then randomly choosing a row.

    Each number could represent a color.

  • benrogers213@yahoo.co.ukbenrogers213@yahoo.co.uk Member, PRO Posts: 14

    That sounds like a great idea. Cheers. I'll let you know if it works. Thanks

Sign In or Register to comment.