Skip to main content

Board

The game board is represented by a standard 2D grid, oriented with (0,0) in the bottom left. The Y-Axis is positive in the up direction, and X-Axis is positive to the right. Coordinates begin at zero, such that a board that is 11x11 will have coordinates ranging from [0, 10].

Battlesnake Coordinate System

{
"height": 11,
"width": 11,
"food": [
{"x": 5, "y": 5},
{"x": 9, "y": 0},
{"x": 2, "y": 6}
],
"hazards": [
{"x": 0, "y": 0},
{"x": 0, "y": 1},
{"x": 0, "y": 2}
],
"snakes": [
{"id": "snake-one", ... },
{"id": "snake-two", ... },
{"id": "snake-three", ... }
]
}
PropertyTypeDescription
heightintegerThe number of rows in the y-axis of the game board. Example: 11
widthintegerThe number of columns in the x-axis of the game board. Example: 11
foodarrayArray of coordinates representing food locations on the game board. Example: [{"x": 5, "y": 5}, ..., {"x": 2, "y": 6}]
hazardsarrayArray of coordinates representing hazardous locations on the game board. Example: [{"x": 0, "y": 0}, ..., {"x": 0, "y": 1}]
snakesarrayArray of Battlesnake Objects representing all Battlesnakes remaining on the game board (including yourself if you haven't been eliminated). Example: [{"id": "snake-one", ...}, ...]