Skip to content

Commit

Permalink
Merge pull request #45 from Code4Community/KevinTest
Browse files Browse the repository at this point in the history
Fix check code
  • Loading branch information
kevindlewis23 authored Jan 14, 2025
2 parents e321678 + 85b203c commit 276872f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,14 @@ document.getElementById("enableCommands").addEventListener("click", (event) => {
gameOver = false;
runner.setProgram(programText);

if (!runner.check()) {
try {
runner.check();
} catch (e) {
alert (e)
runner.setProgram("");
} finally {
runner.reset();
return;
}
runner.reset();
}
});


Expand Down

0 comments on commit 276872f

Please sign in to comment.