Last active
August 22, 2017 15:17
-
-
Save gilad905/bd30b5c3e5dd8c0165fc47c173ac0a54 to your computer and use it in GitHub Desktop.
Revisions
-
gilad905 revised this gist
Aug 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Ant Queen of the Hill Contest - Debugging Tools --------------- Some handy functions that you can use for better debugging your answers. -
gilad905 revised this gist
Aug 22, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Debugging Tools Some handy functions that you can use for better debugging your answers. Paste these into the developer tools' console before starting a game (once, not for each game). // Pauses the game (just like hitting the 'pause' button) console.pause = function() { @@ -20,6 +20,7 @@ Paste these into the developer tools' console before starting a game (once, not You can then use them in your answer, e.g: ... if (view[4].ant.type == 5 && view[4].ant.food > 10) console.pause(); -
gilad905 revised this gist
Aug 22, 2017 . 1 changed file with 18 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,26 +2,27 @@ Debugging Tools --------------- Some handy functions that you can use for better debugging your answers. Paste these into the developer tools' console before starting a game (once, not for each game): // Pauses the game (just like hitting the 'pause' button) console.pause = function() { console.log("PAUSE"); $('#pause').trigger('click'); }; // Sets the game step delay to a new value console.setDelay = function(value) { console.log("SET DELAY"); $('#delay').val(value); $('#delay').trigger('change'); }; You can then use them in your answer, e.g: ... if (view[4].ant.type == 5 && view[4].ant.food > 10) console.pause(); else if (view[4].ant.type == 1 && view[4].color.red) console.setDelay(1000); ... -
gilad905 renamed this gist
Aug 22, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
gilad905 created this gist
Aug 22, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ Debugging Tools --------------- Some handy functions that you can use for better debugging your answers. Paste these into the developer tools' console before starting a game (once, not for each game): // Pauses the game (just like hitting the 'pause' button) console.pause = function() { console.log("PAUSE"); $('#pause').trigger('click'); }; // Sets the game step delay to a new value console.setDelay = function(value) { console.log("SET DELAY"); $('#delay').val(value); $('#delay').trigger('change'); }; You can then use them in your answer, e.g: ... if (view[4].ant.type == 5 && view[4].ant.food > 10) console.pause(); else if (view[4].ant.type == 1 && view[4].color.red) console.setDelay(1000); ...