Currently, when you instance
a new letter, it's free to randomly select any of the 26 items in your alphabet. Since there's (currently) no way for the letter generation to be aware of what has / has not already been generated, it's not possible to get the necessary mix of consonants and vowels.
Instead of letting LetterTile
randomly decide what letter it represents, I'd change the code so that Main
tells LetterTile
what letter it will be. That simplifies the problem, because then Main
can be in charge of the mix of consonants and vowels as it can have access to all of the chosen letters at the same time.
Regarding how to get Main
to choose between consonants and vowels, there are lots of ways. One easy way might be to store the two letter types separately from each other. Then, you could choose from the set of vowels how ever many times you want, and then choose the remainder of the letters from the set of consonants.