javascript - Printing previous answers -


i creating game user has try , guess combination of code. want user able see previous attempts has had. @ moment can div box's in display recent code.

here code function is.

game.countanimals = function(playergo){          var count = {bulls:0, cows:0};         game.counter = 1;         (var = 0; < playergo.length; i++) {             var digpresent = playergo.indexof(game.score[i]);             if (playergo[i] == game.score[i]) {count.bulls++;}             else if (digpresent>=0) {count.cows++;}             game.counter++             if (count.bulls == playergo.length && game.counter < 7){                 console.log("you have won")}                 else if (count.bulls !== playergo.length && game.counter < 7) {                     console.log("sorry homes")}                     else if (count.bulls !== playergo.length && game.counter > 7 ){console.log ("you lose");}                     }                 $(".scoreboard1").html(count.cows);                 $(".scoreboard2").html(count.bulls); 


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -