diff --git a/src/NetscriptFunctions/Worm.ts b/src/NetscriptFunctions/Worm.ts index 904a3afe5f..f841cb9cb4 100644 --- a/src/NetscriptFunctions/Worm.ts +++ b/src/NetscriptFunctions/Worm.ts @@ -134,7 +134,7 @@ export function NetscriptWorm(): InternalAPI { const session = getSession(ctx, sessionIdentifier); const input = helpers.string(ctx, "input", _input); return helpers.netscriptDelay(ctx, wormTestingTime(ctx.workerScript.scriptRef.threads)).then(() => { - const finalState = session.evaluate(input); + const finalState = session.evaluate(input, true); return Promise.resolve(finalState); }); }, diff --git a/src/Worm/WormSession.ts b/src/Worm/WormSession.ts index 371d8f2774..94b57fde00 100644 --- a/src/Worm/WormSession.ts +++ b/src/Worm/WormSession.ts @@ -59,15 +59,15 @@ export class WormSession { this.testsDone = 0; } - evaluate(input: string) { - this.testsDone += 1; + evaluate(input: string, userInput: boolean) { + if (userInput) this.testsDone += 1; return evaluateInput(this.graph, input); } isPathCorrect() { return ( this.guess.path.length === this.graph.properties.pathLength && - this.evaluate(this.guess.path) === this.graph.targetState + this.evaluate(this.guess.path, false) === this.graph.targetState ); } diff --git a/src/Worm/ui/WormInput.tsx b/src/Worm/ui/WormInput.tsx index 45f120656e..6b5d4be3af 100644 --- a/src/Worm/ui/WormInput.tsx +++ b/src/Worm/ui/WormInput.tsx @@ -56,7 +56,7 @@ export function WormInput() { function handleTest() { const session = getWormUISession(); - const result = session.evaluate(input); + const result = session.evaluate(input, true); setState(result); }