'use strict'; const { Core } = require('./core.js'); const { DAT, MOV, ADD, SUB, CMP, SLT, JMP, JMZ, JMN, DJN, SPL, } = require('./instruction.js'); class Warrior { constructor(start) { this.queue = [start]; } isDead() { return (this.queue.length === 0); } append(heads) { this.queue.push(...heads); } next() { const pc = this.queue[0]; this.queue = this.queue.slice(1); return next; } }; class RedcodeVm { constructor(coresize, warriors) { this.core = new Core(coresize); } };