//*********************************************** public Form1() { InitializeComponent(); // To initialize the automaton object myAutomaton.states = new string[3]; myAutomaton.states[0] = "Q0"; myAutomaton.states[1] = "Q1"; myAutomaton.states[2] = "Q2"; myAutomaton.alphabet = new string[2]; myAutomaton.alphabet[0] = "a"; myAutomaton.alphabet[1] = "b"; myAutomaton.transitionFunction = new string[3, 2]; myAutomaton.transitionFunction[0, 0] = textBoxQ0a.Text; myAutomaton.transitionFunction[0, 1] = textBoxQ0b.Text; myAutomaton.transitionFunction[1, 0] = textBoxQ1a.Text; myAutomaton.transitionFunction[1, 1] = textBoxQ1b.Text; myAutomaton.transitionFunction[2, 0] = textBoxQ2a.Text; myAutomaton.transitionFunction[2, 1] = textBoxQ2b.Text; myAutomaton.initialState = "Q0"; myAutomaton.finalStates = new string[1]; myAutomaton.finalStates[0] = "Q1"; myAutomaton.actualState = "Q0"; myAutomaton.actualLetter = "a"; // To clear the text AutomatonLog.Clear(); AutomatonStrings.Clear(); }
public void start(string[] args) { // To initialize the automaton object myAutomaton.states = new string[3]; myAutomaton.states[0] = "Q0"; myAutomaton.states[1] = "Q1"; myAutomaton.states[2] = "Q2"; myAutomaton.alphabet = new string[2]; myAutomaton.alphabet[0] = "a"; myAutomaton.alphabet[1] = "b"; myAutomaton.transitionFunction = new string[3, 2]; myAutomaton.transitionFunction[0, 0] = textBoxQ0a.Text; myAutomaton.transitionFunction[0, 1] = textBoxQ0b.Text; myAutomaton.transitionFunction[1, 0] = textBoxQ1a.Text; myAutomaton.transitionFunction[1, 1] = textBoxQ1b.Text; myAutomaton.transitionFunction[2, 0] = textBoxQ2a.Text; myAutomaton.transitionFunction[2, 1] = textBoxQ2b.Text; myAutomaton.initialState = "Q0"; myAutomaton.finalStates = new string[1]; myAutomaton.finalStates[0] = "Q1"; myAutomaton.actualState = "Q0"; myAutomaton.actualLetter = "a"; // To clear the text AutomatonLog.Clear(); AutomatonLog.AppendText("\n" + "Q0" + " Estado inicial"); AutomatonStrings.Clear(); }
//******************************************************** //******************************************************** // Automaton AFD private void buttonReset_Click(object sender, EventArgs e) { // To initialize the automaton object myAutomaton.states = new string[3]; myAutomaton.states[0] = "Q0"; myAutomaton.states[1] = "Q1"; myAutomaton.states[2] = "Q2"; myAutomaton.alphabet = new string[2]; myAutomaton.alphabet[0] = "a"; myAutomaton.alphabet[1] = "b"; myAutomaton.transitionFunction = new string[3, 2]; myAutomaton.transitionFunction[0, 0] = textBoxQ0a.Text; myAutomaton.transitionFunction[0, 1] = textBoxQ0b.Text; myAutomaton.transitionFunction[1, 0] = textBoxQ1a.Text; myAutomaton.transitionFunction[1, 1] = textBoxQ1b.Text; myAutomaton.transitionFunction[2, 0] = textBoxQ2a.Text; myAutomaton.transitionFunction[2, 1] = textBoxQ2b.Text; myAutomaton.initialState = "Q0"; myAutomaton.finalStates = new string[1]; myAutomaton.finalStates[0] = "Q1"; myAutomaton.actualState = "Q0"; myAutomaton.actualLetter = "a"; // To clear the text AutomatonLog.Clear(); AutomatonLog.AppendText("********Think Outside the BOX *********" + "\n" + "Q0" + " Estado inicial"); AutomatonStrings.Clear(); }