Type alias BoardTransform

BoardTransform: ((x, y) => {
    x: number;
    y: number;
})

This is intended to be an "easy to understand" method of generating a unique id for a board position.

The "id" is the list of all the positions of the stones, black first then white, separated by a colon.

There are in fact 8 possible ways to list the positions (all the rotations and reflections of the position). The id is the lowest (alpha-numerically) of these.

Colour independence for the position is achieved by takeing the lexically lower of the ids of the position with black and white reversed.

The "easy to understand" part is that the id can be compared visually to the board position

The downside is that the id string can be moderately long for boards with lots of stones

Type declaration

    • (x, y): {
          x: number;
          y: number;
      }
    • Parameters

      • x: number
      • y: number

      Returns {
          x: number;
          y: number;
      }

      • x: number
      • y: number