You’re welcome! I would use parseEquation for that one. Add this to the input (don’t forget to mark the sketch as readOnly):
correct = parseEquation(this.latex).differenceFunction("w").evaluateAt(52)=0 correct: correct
The parseEquation reads the latex as an equation and the difference function subtracts the left side and the right side of the equation. Since there should be a “w” variable, if we substitute 52, the difference should be 0. This will allow for different iterations of the equation too i.e. w+w+76=180.
You could also toss in an errorMessage to make sure the correct variable is being used. This goes in the input too.
ev1 = simpleFunction(parseEquation(this.latex).lhs, "w").evaluateAt(52) ev2 = simpleFunction(parseEquation(this.latex).rhs, "w").evaluateAt(52) errorMessage: when isUndefined(ev1) or isUndefined(ev2) "Only use the w variable" otherwise ""