I have a map from which I want to get a word for a game of the hangman. In the map I keep with each word the times that have already been chosen. For example, the map may contain:
abaleadura 4
abajo 2
abalada 1
abalaustrado 3
The map starts with all the words to zero.
The question is: How to get a word randomly so that those that have least appeared are more likely to leave? I have tried to repeat the words in a list and get a word from that list but I have trouble knowing how many times I have to repeat each word. Greetings and thanks.