beaucarnes / fcc-project-tutorials

freeCodeCamp video project tutorials.
293 stars 416 forks source link

Generation continue running also after clearing grid. #15

Open himanshush200599 opened 6 years ago

himanshush200599 commented 6 years ago

If a clicked clear button, generation still increasing continuosly. i want, if clear button press then generation should set to 0 and stop till playButton press.

ImAbhishekTomar commented 5 years ago

Update this function...

Code..

function declareWinner(who) {
    document.querySelector(".endgame").style.display = "block";
    document.querySelector(".endgame .text").innerText = who;

    for (var i = 0; i < cells.length; i++) {
        cells[i].removeEventListener('click', turnClick, false);
    }
}