Hacker News new | ask | show | jobs
by VBprogrammer 5303 days ago
Little bug fix, apples can appear under the snake..

   --- snake.html	2011-12-09 08:03:47.000000000 +0000
   +++ snake.html.2	2011-12-09 11:40:54.414774460 +0000
   @@ -59,7 +59,7 @@
   	var n = AP(s[0],d);
   	(OB(n) || TC(n)) && fail();
   	s.unshift(n);
   -	EQ(s[0],a) && (a = RP()) || s.pop();
   +	EQ(s[0],a) && (function() {do {a = RP()} while (TC(a))}()) || s.pop();

   	c.clearRect(0,0,128,128);
   	blocks(s);
1 comments

Whoops, I see someone below beat me to it.