I am writing a program where I need to shuffle a list of persons and link them to another person from the list. But the problem is with odd numbers, because 1 person can be linked to themself. (I made that impossible so then nothing happens.)
For example, if there are 3 persons called 'Bill', 'John' and 'Jonas'. If 'Bill' gets 'Jonas' and 'Jonas' gets 'Bill', then 'John' is getting linked to 'John', but I made that impossible (to get themself) so nothing happens then.
Does anyone know how I can fix this?
Aucun commentaire:
Enregistrer un commentaire