private void btnCheckWord_Click(object sender, EventArgs e) { string word = tbWord.Text; bool check = WordChecker.checkWord(word, automaton); tbWordCheck.Text = check ? "✔" : "✘"; }
private void checkWords(Automaton inputAutomaton) { lbWords.Items.Clear(); inputAutomaton.Words?.ForEach(x => { bool check; if (inputAutomaton.Stack == null) { check = WordChecker.checkWord(x, inputAutomaton); } else { check = StackChecker.checkWordPDA(x, inputAutomaton); } string text = x + (check ? "✔" : "✘"); lbWords.Items.Add(text); }); }
public void checkWordTest_passWordAndAutomatonAndCurrentState_ReturnsBool(int automatonIndex, string inputWord) { Automaton inputAutomaton = automatons[automatonIndex]; Assert.IsTrue(WordChecker.checkWord(inputWord, inputAutomaton, inputAutomaton.States[0].Name)); }