FormeleMethode/Automata.cs
/// <summary>
/// Recursive function to gett all possible Words in the language
/// </summary>
/// <param name="letterIndex">Index of the letter.</param>
/// <param name="currentWord">The current word.</param>
/// <param name="words">The words.</param>
/// <param name="maxLength">The maximum length.</param>
/// <returns></returns>
Recursive function to gett all possible Words in the language
Recursive function to gett all possible Words in the language
public List<string> NextLetter(int letterIndex, char[] currentWord, List<string> words, int maxLength)
		{
			for (int i = 0; i < symbols.Count; i++)
			{
				currentWord[letterIndex] = symbols.ToList()[i];
				if (letterIndex == maxLength - 1)
				{
					words.Add(new string(currentWord));
				}
				else
				{
					words.Add(new string(currentWord));
					NextLetter(letterIndex + 1, currentWord, words, maxLength);
				}
			}
			return words;
		}
public List < string > NextLetter ( int letterIndex , char [ ] currentWord , List < string > words , int maxLength ) { for ( int i = 0 ; i < symbols . Count ; i ++ ) { currentWord [ letterIndex ] = symbols . ToList ( ) [ i ] ; if ( letterIndex == maxLength - 1 ) { words . Add ( new string ( currentWord ) ) ; } else { words . Add ( new string ( currentWord ) ) ; NextLetter ( letterIndex + 1 , currentWord , words , maxLength ) ; } } return words ; }
Recursive function to gett all possible Words in the language
Recursive function to gett all possible Words in the language
// For all possible symbols
None
letterIndex
int
Index of the letter.
Index of the letter .
currentWord
char[]
The current word.
The current word .
words
List<string>
None
maxLength
int
The maximum length.
The maximum length .