createSnake:function(){
for(var i=this.i_len;i>0;i–)
this.cells.push({x:i,y:0});
},
why we are runnig a reverse loop here?
Loop Doubt! why reverse
@tan15hq
You can use normal loop as well
Only the logic will change in order of processing of snake that’s all
You may use normal loop and change the code accordingly
Happy coding !!
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.