title: How can I optimize permutations of words in a Scrabble game?
body: <p>I am attempting to make the logic for the opponent in a scrabble game.</p>
  
  <p>I have done a lot of thinking and come to the conclusion that I need to use <code>anagrams</code> and check those anagrams against a list of words in a dictionary file to see if the generated word is in fact a word contained in the dictionary file.</p>
  
  <p>The issue I'm having is <code>optimization</code>. Because this anagram uses <code>recursion</code> and runs up to 8 factorial, there tends to be many 'junk' words generated that do not exist in any dictionary, such as repetitions of  a single letter.</p>
  
  <p>There has to be some sort of check to see if the permutations are valid and not just a repetition of 1 character. So far, I'm at a loss for how to do this both <em>quickly</em> and <em>accurately</em>.</p>
  
  <p>In English, words seem to be formed by both vowels and consonants. I was thinking of checking if a word contains at least 1 vowel and at least 1 consonant, however there are some exceptions where words can contain only vowels or only consonants. So this method seems to go out the window.</p>
  
  <p>Now I may be missing something crucial, but short of brute-forcing my way through all permutations I have no real idea of how to check in a way that is sufficiently fast enough for gameplay.</p>
  
  <hr>
  
  <p><strong>My question is:</strong></p>
  
  <p><em>Can anyone suggest a method that will work 100% of the time to optimize the number of permutations generated?</em></p>
  
  <hr>
  
  <p>I don't need useless ones generated and these turn out to be the bulk of what is generated.</p>
  
  <p>I believe this to a good approach, however at the same time I believe that I must be missing something that is much faster and more appropriate for what I want to achieve.</p>
  
  <p>If anyone could suggest a way to check if words are actually viable or not, OR if you could suggest a better way of approaching the situation, it'd be greatly appreciated.</p>
  
  <p>Thanks.</p>