Reputation: 27
I am trying to create a "simon says" game, the problem is that when this function executes, the condition in the if never become true, even if I click on the buttons that push a value to the array.
function start(patron, patronl){
if (patronl.length<patron.length){
setTimeout(start,1000,patron, patronl);
} else {
patronl=[];
patron.push(rand(1,4));
runp(patron);
start(patron,patronl);
}
}
$("#col4").click(function(){
patronl.push(4);
})
Here is the example code of what I am trying to do
Here is my code
Upvotes: 0
Views: 33