/// <summary> /// Break input down into a list of Passphrases. /// </summary> /// <param name="input">The input string.</param> /// <returns>The input string converted into a list of Passphrases.</returns> private List <Passphrase> ParseInput(string input) { string[] inputArray = input.Split('\n'); List <Passphrase> passphrases = new List <Passphrase>(); foreach (string entry in inputArray) { Passphrase passphrase = new Passphrase(); string[] words = entry.Split(' '); foreach (string word in words) { passphrase.AddWord(word); } passphrases.Add(passphrase); } return(passphrases); }
/// <summary> /// Check if a passphrase is free of duplicate anagrams. /// </summary> /// <param name="passphrase">The passphrase to check.</param> /// <returns>True if the passphrase has no duplicate anagrams; false otherwise.</returns> private bool PassphraseHasNoDuplicateAnagrams(Passphrase passphrase) { return(!passphrase.DetectDuplicateAnagrams()); }