Beispiel #1
0
        private void findWays(thread th, AState state, string way)
        {
            if (state.MNextStates.Length != 0)
            {
                for (int i = 0; i < state.MNextStates.Length; i++)
                {
                    AState nextState = (AState)th.MIDToIState[state.MNextStates[i]];
                    string newString = way;
                    newString += state.buildText(i);
                    findWays(th, nextState, newString);
                }
            }
            else
            {
                if (!File.Exists("way0.txt"))
                {
                    File.Create("way0.txt");
                }

                StreamWriter sw = new StreamWriter("way0.txt", true, System.Text.Encoding.Default);
                sw.Write(way);
                sw.Close();
                ways++;
            }
        }