function( a, // The array containing the points of the snake b, // The next step snake head should move to c, // The apple position d, // The size of the level e // Just declaration ) { a.unshift(b); // Move the head of the snake forward c^a[0]&&a.pop(); // If we don't hit apple, decrement snake tail for(b=d*d;b--;) // Loop through level e=[e]+"■ "[!~a.indexOf(b)&b!=c]+["\n"[b%d]]; // Put space or snake(or apple) body, and line end if needed return~a.indexOf(a[0],1)||e // Return rendered level as string, or a number if game is over }