Replacing the php in your code with java-script (see modified code below) and adding console.log to the method calls allowed for the location of the infinite recursion loop to be located, giving an output in the console of: > logic_game(15) OpenedEmpt圜ells = checkForEqualVal(, openedEmpt圜ells) ĭocument.getElementById("num_" + idNumericPart). = '#eee' ĭocument.getElementById("num_" + idNumericPart).parentElement.innerHTML = value ĭocument.getElementById("num_" + idNumericPart).parentElement.innerHTML = '' ĬheckValue = document.getElementById("check").checked ĭocument.getElementById(id).parentElement.innerHTML = valueToBeSubstitude While (randomMinesLocation.length 56 & j = -1 ) continue this while loop is responsible for generating 10 different mines in random from 1 to 64 Var empt圜ells = new Array() // this array will contain the empty cells opened to prevent the recursion going through the same cell again Var mineProtecition = new Array() // this array will contain the mine with flags to not be abled to open when the player clicks on it Var randomMinesLocation = new Array() // this array will contain the id number part of the mines Could you please see the code and correct the part where I've made a mistake? "
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |