One function is your snake's whole brain. Every tick the game calls it with what your snake can see, and it answers with a direction.
| state.me | { body, direction, alive } | your snake โ the head is body[0] |
| state.foods | [{x, y}, โฆ] | apples (fog mode: only the ones you can see) |
| state.others | [{ body, direction, alive }, โฆ] | every rival snake |
| state.board | { width: 60, height: 60 } | the world โ walls at the edges |
| state.tick | 418 | heartbeat count |
| returns | 'UP' | one of the four direction strings |