src/anagramsolver/services/LoopSetsHelper.cs
/// <summary>
/// When this method is called we know that the characters in the sentence match (isSubset of) anagram
/// In here we loop through the order of the words and check md5
/// </summary>
/// <param name="numberOfJackpots"></param>
/// <param name="words"></param>
/// <param name="listOfWordPermutationsReplacementString"></param>
/// <returns></returns>
When this method is called we know that the characters in the sentence match (isSubset of) anagram
In here we loop through the order of the words and check md5
When this method is called we know that the characters in the sentence match ( isSubset of ) anagram In here we loop through the order of the words and check md5
public bool LoopPermutationsAndCheckMd5RemoveFoundHash(ref int numberOfJackpots, string[] words, string[] listOfWordPermutationsReplacementString)
        {
            bool gotJackpot = false;
            foreach (var permutationReplacementString in listOfWordPermutationsReplacementString)
            {
                if (!gotJackpot)
                {
                    var gotJackpotTest = checkMd5RemoveFoundHash(ref numberOfJackpots, string.Format(permutationReplacementString, words));
                    if (gotJackpotTest.HasValue)
                    {
                        gotJackpot = gotJackpotTest.Value;
                        if (gotJackpot)
                        {
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            return gotJackpot;
        }
public bool LoopPermutationsAndCheckMd5RemoveFoundHash ( ref int numberOfJackpots , string [ ] words , string [ ] listOfWordPermutationsReplacementString ) { bool gotJackpot = false ; foreach ( var permutationReplacementString in listOfWordPermutationsReplacementString ) { if ( ! gotJackpot ) { var gotJackpotTest = checkMd5RemoveFoundHash ( ref numberOfJackpots , string . Format ( permutationReplacementString , words ) ) ; if ( gotJackpotTest . HasValue ) { gotJackpot = gotJackpotTest . Value ; if ( gotJackpot ) { break ; } } else { break ; } } else { break ; } } return gotJackpot ; }
When this method is called we know that the characters in the sentence match (isSubset of) anagram
In here we loop through the order of the words and check md5
When this method is called we know that the characters in the sentence match ( isSubset of ) anagram In here we loop through the order of the words and check md5
// did we get lucky? - loop permutations of the words in the sentence // Break if sentence was found // Break if no more md5 hashes in list // Break if sentence was found
None
int
ref
words
string[]
None
listOfWordPermutationsReplacementString
string[]
None
numberOfJackpots
None