aocpp/lib/include/intcode/Interpreter.hpp

27 lines
385 B
C++
Raw Normal View History

2022-11-04 09:38:01 -07:00
#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