Each mode tweaks the grid size, obstacle count, speed curve, and scoring bonus. Pick the vibe that matches your focus level.
Power ups spawn periodically and are stored until activated. Here's what each icon means:
AUTO mode hands control to JavaScript that you provide. Paste a strategy below to replace the built-in pathfinding.
When AUTO is enabled, each finished run is auto-saved to the leaderboard as "AUTO" and the next run begins automatically.
State input
{ x, z, duplicate } metadata.{ x, z, type }.{ type, remaining } and metadata such as value for multipliers or portals for portal pairs.{ x, z, burning, life, flash } so your logic can dodge burn penalties.{ x, z, direction, life }.{ size, half }.powerSpawn (seconds until the next pickup) and trailCross.clamp, manhattan, directionTo, rotateLeft, rotateRight, reverse, vector (cardinal clamp), and randomChoice.{ difficulty, score, applesEaten, snakeLength, moveInterval, baseMoveInterval, powerSpawnInterval, scoreMultiplier, elapsedTime, moves } plus lifecycle helpers: runId (increments every restart), gameStarted, gameOver, and paused.Expected output
Return a cardinal direction as an object { x, z }, an array [x, z], or commands like "left", "right", "forward", "back", "north", "south", etc. Values are clamped to -1, 0, or 1, and invalid responses keep the previous heading.