Answer the question
In order to leave comments, you need to log in
How to check if there is the same element in the sheet, and if there is, then a new one?
The trick is that you need to check if the randomly selected character is already in the list of characters, then randomly select the character again and check again. How to make it infinite until such a character is not in the list?
Thank you!
Answer the question
In order to leave comments, you need to log in
In pseudocode something like this:
uniqueCharacterSelected = false;
while not(uniqueCharacterSelected ) {
newCharacter = SelectRandomCharacter();
if (charactersList.find(newCharacter)=-1) {
charactersList.add(newCharacter);
uniqueCharacterSelected = true;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question