Level 1 โ ๐ฒ Random Randy
BEST OF 3ยท vs ยท
LENGTH ยท longest wins at the time limit โฑโ
๐ฎ Level 1: play by hand. Coding unlocks at Level 2.
nextMove(state) โ 'UP' ยท 'DOWN' ยท 'LEFT' ยท 'RIGHT'
| state.me | { body, direction, alive } | your snake โ head is body[0] |
| state.foods | [{x, y}, โฆ] | apples on the board |
| state.others | [{ body, โฆ }, โฆ] | the rival snake(s) |
| state.board | { width: 24, height: 24 } | walls at the edges |
| returns | 'UP' | where your head steps next |
Start from:
Slow it down to prove it's strategy, not speed. Change anytime; flip back to Normal to fast-forward.
Losing by hand? Bots don't blink. Write one and let it play for you โ