const fs = require('fs') const { stdin, stdout } = require('./lib/stdin') const JSZM = require('./lib/jszm-async') const filename = './games/zork1.dat' const bytecode = fs.readFileSync(filename) const zm = new JSZM(bytecode) zm.print = stdout() zm.read = stdin() const main = async () => { let line = {value: '', done: false } const machine = await zm.run() await machine.next(line.value) process.exit() } main().catch(console.log)