Hacker News new | ask | show | jobs
by kennethkl 4597 days ago
lines like: dx = (e.keyCode - 38) % 2, dy = (e.keyCode - 39) % 2; is cheating. In that case, you could probably make it 1 line of javascript.
1 comments

I agree, there are like 7 lines that bunch together logic using commas.

This one has three operations in one line:

  newEl.className = newEl.className.replace(' f', ''), length++, hasFood = false;