diff --git a/README.md b/README.md index 6a888d2..85651b2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,7 @@ -battleboat -========== +# battleboat A JavaScript AI that beats humans at battleship. Play the game here: [https://billmei.github.io/battleboat](https://billmei.github.io/battleboat) -If you've forked a copy of this repo or are playing around with the code on the `https://billmei.github.io/battleboat` page, please be nice and don't hack the `Stats` object. I'm using Google Analytics to collect info about the AI's win/loss percentage in order to improve the bot, so if you do look around, I kindly ask that you don't give it bad data. Thanks :) - If you want to try stuff out, run `setDebug(true);` in the console before doing anything. You'll also get access to some cool features. diff --git a/index.html b/index.html index 30d2982..bc2f132 100644 --- a/index.html +++ b/index.html @@ -73,19 +73,6 @@

Enemy Fleet

Fork me on GitHub - - - diff --git a/js/battleboat.js b/js/battleboat.js index 36f0683..3e03dd4 100644 --- a/js/battleboat.js +++ b/js/battleboat.js @@ -11,12 +11,7 @@ // finished placing their ships, or she can cheat easily by placing her ships // outside the regions with the highest probability. -console.log("%cHi! Thanks for checking out this game.%c Please be nice and don't " + - "hack the Stats object, I'm using Google Analytics to collect info about " + - "the AI's win/loss percentage in order to improve the bot, so if you do " + - "look around, I kindly ask that you don't give it bad data. Thanks :)", - "font-weight: bold; font-family: Tahoma, Helvetica, Arial, sans-serif;", ""); -console.log("Also, if you want to try stuff out, run %csetDebug(true);%c in the " + +console.log("If you want to try stuff out, run %csetDebug(true);%c in the " + "console before doing anything. You'll also get access to some cool features.", "background: #000; color: #0f0; padding: 2px 5px; border-radius: 2px;", ""); @@ -75,18 +70,12 @@ Stats.prototype.hitShot = function() { Stats.prototype.wonGame = function() { this.gamesPlayed++; this.gamesWon++; - if (!DEBUG_MODE) { - gtag('event', 'gameOver', {'win': this.uuid}); - } }; Stats.prototype.lostGame = function() { this.gamesPlayed++; - if (!DEBUG_MODE) { - gtag('event', 'gameOver', {'lose': this.uuid}); - } }; // Saves the game statistics to localstorage, also uploads where the user placed -// their ships to Google Analytics so that in the future I'll be able to see +// their ships to GA so that in the future I'll be able to see // which cells humans are disproportionately biased to place ships on. Stats.prototype.syncStats = function() { if(!this.skipCurrentGame) { @@ -109,10 +98,6 @@ Stats.prototype.syncStats = function() { stringifiedGrid += '(' + x + ',' + y + '):' + mainGame.humanGrid.cells[x][y] + ';\n'; } } - - if (!DEBUG_MODE) { - gtag('event', 'humanGrid', {stringifiedGrid: this.uuid}); - } }; // Updates the sidebar display with the current statistics Stats.prototype.updateStatsSidebar = function() {