コード例 #1
0
        private void GetOutput()
        {
            while (_outputQueue.Count == 0)
            {
                _vm.Step();
                if (_vm.IsDone)
                {
                    return;
                }
            }
            long paintColour = _outputQueue.Dequeue();

            while (_outputQueue.Count == 0 && _vm.IsDone == false)
            {
                if (_vm.IsDone)
                {
                    return;
                }
                _vm.Step();
            }
            long turnDirection = _outputQueue.Dequeue();

            DoPaint(paintColour);
            DoTurn(turnDirection);
            DoMove();
        }
コード例 #2
0
 public void Step() => _intcodeVirtualMachine.Step();