For a letter game for children:
the app picks a random letter from a random list and is supposed to write this letter on 7 random buttons out of 49. Why do usually 7 letters appear (as it should be) but sometimes only 6, and once only 5??
The list of buttons, it is to go through, is complete; all buttons have precisely the same settings in the designer, all being visible and so.
getNumber gets the number to go in the buttons
buttonList is generated in the while test to get a unique list of 7 buttons
previous button settings cleared
new number set to buttonList
I think the problem is that I rely on indexes when picking and later deleting an item from the list rather than using the content. When a used item is deleted from the list, of course, the index can be reused. Therefore, the letter can be written on the same button again.