'use strict'; const process = require('node:process'); const fs = require('node:fs'); const { assemble } = require('./parser/parser.js'); const { RedcodeVm } = require('./vm/vm.js'); const files = process.argv.slice(2); if (files.length === 0) { console.log("no input files provided!"); } const warriors = files.map(fname => { const source = fs.readFileSync(fname, 'utf8'); return assemble(source); }); const vm = new RedcodeVm(8000, warriors); console.log(vm.run(100000));