Published
Edited
Dec 20, 2018
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
part1 = {
let register = [0, 0, 0, 0, 0, 0];

while (register[IP_REGISTER] < INSTRUCTIONS.length && register[IP_REGISTER] >= 0) {
let [currentInstruction, a, b, c] = INSTRUCTIONS[register[IP_REGISTER]];
calculate[currentInstruction](register, a, b, c);
register[IP_REGISTER]++;
}
return register[0];
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more