Support insta-checking for legacy puzzles

This commit is contained in:
Neale Pickett 2020-03-16 10:20:03 -06:00
parent 25c3bdc72c
commit 742020a597
1 changed files with 2 additions and 3 deletions

View File

@ -84,11 +84,11 @@ async function possiblyCorrect(answer) {
return answer
}
for (let end = 0; end <= answer.length; end += 1) {
if (window.puzzle.xAnchors.includes("end") && (end != answer.length)) {
if (window.puzzle.xAnchors && window.puzzle.xAnchors.includes("end") && (end != answer.length)) {
continue
}
for (let beg = 0; beg < answer.length; beg += 1) {
if (window.puzzle.xAnchors.includes("begin") && (beg != 0)) {
if (window.puzzle.xAnchors && window.puzzle.xAnchors.includes("begin") && (beg != 0)) {
continue
}
let sub = answer.substring(beg, end)
@ -266,4 +266,3 @@ if (document.readyState === "loading") {
} else {
init()
}