Exemplo n.º 1
0
 static void Main(string[] args)
 {
     Console.InputEncoding = new ASCIIEncoding();
     Runner runner = new Runner();
     //runner.LoadAndRun(ExamplePrograms.HelloWorld);
     //runner.LoadAndRun(ExamplePrograms.LowerToUpper);
     //runner.LoadAndRun(ExamplePrograms.Fibonacci);
     runner.LoadAndRun(ExamplePrograms.Rot13);
     Console.ReadLine();
 }
 public StateMachine(Runner runner)
 {
     _runner = runner;
     actions.Add(OpCode.BeginLoop, BeginLoop);
     actions.Add(OpCode.DecrementPointer, DecrementPointer);
     actions.Add(OpCode.DecrementValue, DecrementValue);
     actions.Add(OpCode.EndLoop, EndLoop);
     actions.Add(OpCode.IncrementPointer, IncrementPointer);
     actions.Add(OpCode.IncrementValue, IncrementValue);
     actions.Add(OpCode.InputValue, InputValue);
     actions.Add(OpCode.OutputValue, OutputValue);
 }