Skip to content

Commit

Permalink
Now we can only execute run code once.
Browse files Browse the repository at this point in the history
  • Loading branch information
sd5869 committed Feb 1, 2018
1 parent 7321810 commit 1758c55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.html
Expand Up @@ -178,6 +178,7 @@ <h4 class="modal-title text-center">Welcome to Angry Coders</h4>


<script>
window.executed = false;
function runcode() {
var extra =
`
Expand Down Expand Up @@ -212,7 +213,10 @@ <h4 class="modal-title text-center">Welcome to Angry Coders</h4>

var code = extra + editor.getValue();
// console.log(code);
eval(code);
if(!window.executed) {
window.executed = true;
eval(code);
}
}

function toggleModal() {
Expand Down
1 change: 1 addition & 0 deletions js/states/Game.js
Expand Up @@ -249,6 +249,7 @@ function resetBall() {
}
function resetGame(c) {
var chances;
window.executed = false;
if (c == undefined) {
chances = AngryCoders.GameState.chances - 1;
}
Expand Down

0 comments on commit 1758c55

Please sign in to comment.