Turing machine (A-B)

//A – B Turing program

_tape =

new char[] { ‘|’, ‘|’, ‘|’, ‘|’,‘|’,‘-‘, ‘|’,‘|’ };

_machineState =

‘A’;

_commands.Add(

new Command(‘A’, ‘|’, ‘|’, Direction.Right, ‘A’));

_commands.Add(

new Command(‘A’, ‘-‘, ‘-‘, Direction.Left, ‘B’));

_commands.Add(

new Command(‘B’, ‘|’, , Direction.Right, ‘C’));

_commands.Add(

new Command(‘B’, , , Direction.Left, ‘B’));

_commands.Add(

new Command(‘C’, , , Direction.Right, ‘C’));

_commands.Add(

new Command(‘C’, ‘-‘, ‘-‘, Direction.Right, ‘D’));

_commands.Add(

new Command(‘D’, ‘|’, ‘|’, Direction.Right, ‘D’));

_commands.Add(

new Command(‘D’, , , Direction.Left, ‘E’));

_commands.Add(

new Command(‘E’, , , Direction.Left, ‘E’));

_commands.Add(

new Command(‘E’, ‘|’, , Direction.Left, ‘F’));

_commands.Add(

new Command(‘F’, ‘|’, ‘|’, Direction.Left, ‘G’));

_commands.Add(

new Command(‘F’, ‘-‘, ‘-‘, Direction.Left, ‘_’));

_commands.Add(

new Command(‘G’, ‘-‘, ‘-‘, Direction.Left, ‘B’));

Leave a comment