Mine Hunter

Mine Hunter pits the AI against a minefield! A known quantity of mines has been distributed across a grid of squares and the AI agent must work out where they are. To help, each uncovered square will show how many mines are in the surrounding squares.

The grid is represented as an array of characters:

FA flagged mine
fAn incorrectly flagged empty space (game over)
#A convered square
XAn exploded mine (game over)
.An uncovered square with no neighbouring mines
1-8An uncovered square with n neighbouring mines

and organised in a two dimentional array (with 0,0 at the top left).

Example board

JSON Representation

"board": [

XML Representaion


Note: in this example the correct response would be to place a flag at 0,1.


Write an AI agent that can solve as many boards as possible, this can be measured by a moving average which is shown on the output.

Algorithms and Hints

There are quite a few algorithms that can be used to solve this scenario:

API Interface

The Swagger specification for this API can be downloaded here.

In each step, the Sandbox Client will send the following information to the AI server:

The AI agent should respond with one or more moves, each move consists of:

Note: there is no limit to the number of moves that can be included in each response. However if a move results in the game ending, subsequent guesses will be ignored rather than carried over to the next game.

JSON Example Request

  "lastMove": {
    "boardID": "1233-5678-90abc-2435",
    "result": "LOST"
  "boardID": "1234-1234-1234-1234",
  "board": [
  "flagsRemaining": 3

JSON Example Response

  "moves": [
      "x": 1,
      "y": 1,
      "flag": true

XML Example Request

<?xml version="1.0" encoding="UTF-8"?>

XML Example Response

<?xml version="1.0" encoding="UTF-8"?>