Handle non-empty memory in ircbotRun(). Turns out [].reduce() passes 4 parameters
This commit is contained in:
parent
cd00c3cded
commit
713ded5adb
4
gir.js
4
gir.js
|
@ -976,8 +976,8 @@ function ircbotRun(program, input, maxCycles = 400000) {
|
|||
// even if there are no indices we can get values that
|
||||
// the rest of the code can work with
|
||||
let memoryIndices = Array.from(result.state.memory.keys());
|
||||
let min = memoryIndices.reduce(Math.min, tapeHead);
|
||||
let max = memoryIndices.reduce(Math.max, tapeHead);
|
||||
let min = memoryIndices.reduce((x,y) => Math.min(x, y), tapeHead);
|
||||
let max = memoryIndices.reduce((x,y) => Math.max(x, y), tapeHead);
|
||||
|
||||
// Get 15 cells of context on each side of tape head
|
||||
// Exception is if max or min comes up before that, in which
|
||||
|
|
Loading…
Reference in New Issue