Example #1
0
        public static string Task28()
        {
            Console.WriteLine("Task 2.8, alphabet {a,b,c,#} - Insert symbol {c} after the first symbol of input");

            string input   = Console.ReadLine();
            int    headPos = GetHeadPos(ref input);

            var machine =
                MachineBuilder.BuildMachine(
                    "/home/paul/coding/algorithms-data-structures/TuringMachines/TuringMachines/data/28.txt");

            return(MachineRunner.Run(input, machine,
                                     endProgramStates: new List <string> {
                "e"
            }, head: headPos, log: true));
        }
Example #2
0
        //    for running Task17() and Task28() - "old" Turing Automates
        public static string Task17()
        {
            Console.WriteLine("Task 1.7, alphabet {a,b,c,#} - In odd word delete all symbols except for the middle");

            string input   = Console.ReadLine();
            int    headPos = GetHeadPos(ref input);

            var machine =
                MachineBuilder.BuildMachine(
                    "/home/paul/coding/algorithms-data-structures/TuringMachines/TuringMachines/data/17.txt");

            return(MachineRunner.Run(input, machine,
                                     endProgramStates: new List <string> {
                "e"
            }, head: headPos, log: true));
        }