private int GetOutputToThrusters(string phases) { var output = new ThrusterOutput(0); var outputChannel = new OutputChannel(output); var inputChannel = new InputChannel(); var computer = new OpCodeComputer.OpCodeComputer(inputChannel, outputChannel); for (var i = 0; i < 5; i++) { var pj = phases[i]; inputChannel.QueueInput(int.Parse(phases.Substring(i, 1))); inputChannel.QueueInput(output.Value); computer.ProcessInstructions(Program); } return((int)output.Value); }
public OutputChannel(ThrusterOutput output) { _output = output; }