27 lines
385 B
C++
27 lines
385 B
C++
#ifndef INTCODE_INTERPRETER_HPP_
|
|
#define INTCODE_INTERPRETER_HPP_
|
|
|
|
#include "Machine.hpp"
|
|
|
|
namespace intcode {
|
|
|
|
struct Input {
|
|
ValueType &pos;
|
|
};
|
|
|
|
struct Output {
|
|
ValueType val;
|
|
};
|
|
|
|
struct Halt {};
|
|
|
|
auto Step(Machine & m) -> std::variant<Input, Output, Halt>;
|
|
|
|
struct BadInstruction : public std::runtime_error {
|
|
explicit BadInstruction(char const* what);
|
|
};
|
|
|
|
} // namespace
|
|
|
|
#endif
|