public static TuringMachine OnlyZeros() { var printOnesTable = new MachineTable(); printOnesTable.AddEntry(new MachineTableEntry("q1", Symbols.AnySymbol, new List<string> { "P1", "R" }, "q1")); return new TuringMachine(printOnesTable, "q1") { Name = "Print only ones" }; }
public TuringMachine(MachineTable machineTable, string initialConfiguration) { _machineTable = machineTable; _currentMConfiguration = initialConfiguration; _internalTape = new Dictionary<int, char>(); ExpandTape(); }
public void Init() { var printOnesTable = new MachineTable(); var machineTableEntry = new MachineTableEntry("q1", Symbols.AnySymbol, new List<string> { "P1,R" }, "q1"); var initialConfiguration = machineTableEntry.MConfiguration; printOnesTable.AddEntry(machineTableEntry); this._machinePrintingOnes = new TuringMachine(printOnesTable, initialConfiguration); }
public static TuringMachine AlternatingZerosOnes() { var printZerosOnesTable = new MachineTable(); printZerosOnesTable.AddEntry(new MachineTableEntry("b", Symbols.AnySymbol, new List<string> { "P0", "R" }, "c")); printZerosOnesTable.AddEntry(new MachineTableEntry("c", Symbols.AnySymbol, new List<string> { "R" }, "e")); printZerosOnesTable.AddEntry(new MachineTableEntry("e", Symbols.AnySymbol, new List<string> { "P1", "R" }, "f")); printZerosOnesTable.AddEntry(new MachineTableEntry("f", Symbols.AnySymbol, new List<string> { "R" }, "b")); var machine = new TuringMachine(printZerosOnesTable, "b") { Name = "Print alternating zeros ones" }; return machine; }