beaucarnes / fcc-project-tutorials

freeCodeCamp video project tutorials.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generation continue running also after clearing grid.

himanshush200599 opened this issue · comments

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.

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);
	}
}