()
| 13 | //creating array as answer |
| 14 | |
| 15 | function create(){ |
| 16 | heading.innerHTML="LEVEL: "+len +" of Simon's Game"; |
| 17 | if(len==1){ |
| 18 | ans[len-1]=Math.ceil(Math.random()*1000)%4; |
| 19 | console.log(ans); |
| 20 | } |
| 21 | else{ |
| 22 | ans[len-1]=Math.ceil(Math.random()*1000)%4; |
| 23 | console.log(ans); |
| 24 | } |
| 25 | //fading in and out next element of the sequence |
| 26 | var id; |
| 27 | id=ans[len-1]+1; |
| 28 | console.log(id); |
| 29 | $("#c"+id).fadeOut().fadeIn(); |
| 30 | i=0; |
| 31 | } |
| 32 | //reading inputs |
| 33 | b1.onclick=function(){ |
| 34 | var flag=0; |