Java: systematically ignore certain 4-letter words randomly chosen from a dictionary?
<p>This one is sort of weird. The code I'm writing is for a particular word game, so it's very specialized.</p>

<p>I've got a <code>HashMap&lt;Integer, String&gt;</code> which at runtime contains 4036 indexed 4-letter words. In the same class, I also have a method <code>random()</code> which will randomly select a word from said <code>HashMap</code>. This is the word that the player starts with. He or she will then change the word 1 letter at a time to form new, valid words. e.g., <em>FIVE</em> -> <em>FIRE</em> -> <em>WIRE</em> -> <em>WISE</em> -> <em>WISH</em> -> <em>etc</em>. Obviously, I don't want the first word chosen to start the player off to be unchangeable (i.e. there are no words to be made from changing one letter).</p>

<p>So I need a different method which checks to see if the randomly chosen word meets this criterion. I'm guessing I'll need to iterate through all 4036 entries. That's easy enough, but how can I check to see if there are any words that are exactly 1 letter off from the randomly chosen word?</p>
