From c644379e79262a7478a7fb9ea8001f315fdb6eaf Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 28 Mar 2024 16:18:36 -0400 Subject: Initial commit --- src/nerdhack.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/nerdhack.cc (limited to 'src/nerdhack.cc') diff --git a/src/nerdhack.cc b/src/nerdhack.cc new file mode 100644 index 0000000..1363096 --- /dev/null +++ b/src/nerdhack.cc @@ -0,0 +1,20 @@ +#include +#include +#include "ui.h" +#include "vm.h" + +int main(int argc, char* argv[]) { + if (argc != 2) { + std::cerr << "Requires path to config as an argument\n"; + return 1; + } + vm::clearAllVMs(); + auto vm = vm::VM(); + auto ui = ui::UI(); + // Read config + std::ifstream ifs(argv[1]); + std::string config((std::istreambuf_iterator(ifs)),(std::istreambuf_iterator())); + vm.start(config); + ui.registerCallbacks(vm); + return 0; +} -- cgit v1.2.3