Generating characters randomly with proper frequencies

101 Views Asked by At

I'm making a game where characters randomly appear on the screen, and the user needs to make words using those characters.

Currently, I have a string array with A,E,I,O,U each being there 3 times; and all the remaining letters in the alphabet once each.

I randomly pick a position and print that character from the string array.

Sometimes the letters picked are good, and good words can be made, but sometI me they aren't.

What's the best way about going upon this?

I'm developing it using Java for Android.

1

There are 1 best solutions below

1
On

The only possibility to be sure that you get "good letters" every time is if you use a word list, read a random word and shuffle the letters.