# ai.dennery.game.wordGrid

- Kind: defs
- Authority: game.dennery.ai
- Lexicon: 1
- Published by [game.dennery.ai](https://lexicon.garden/identity/did:plc:com7beprxcim4u4ezzroudpc), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:com7beprxcim4u4ezzroudpc/ai.dennery.game.wordGrid)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:com7beprxcim4u4ezzroudpc/ai.dennery.game.wordGrid/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:com7beprxcim4u4ezzroudpc/ai.dennery.game.wordGrid/analytics)

## #boardLayout (`ai.dennery.game.wordGrid#boardLayout`)

Type: object

WordGrid v1 board: 13x13, 32 premium squares, center [6,6] is doubleWord.

### Properties

- `premium` (array, required)
  - `items` (object)
- `size` (integer, required)

## #move (`ai.dennery.game.wordGrid#move`)

Type: object

One WordGrid placement turn.

### Properties

- `formedWords` (array, required)
  - Constraints: maxLength: 8
  - `items` (string)
    - Constraints: maxLength: 13
- `placements` (array, required)
  - Constraints: maxLength: 7
  - `items` (object)
- `scoreClaim` (integer, required)
  - Constraints: minimum: 0

## #state (`ai.dennery.game.wordGrid#state`)

Type: object

Authoritative WordGrid board. Rack letters never appear on-ledger, only counts.

### Properties

- `grid` (array, required): 13 rows of 13 chars: A-Z placed, . empty, * wild.
  - Constraints: minLength: 13, maxLength: 13
  - `items` (string)
    - Constraints: minLength: 13, maxLength: 13
- `nextActor` (string · did)
- `rackCount` (array)
  - `items` (object)
- `scores` (array, required)
  - `items` (object)

## #tile (`ai.dennery.game.wordGrid#tile`)

Type: object

One tile. Wild tiles use letter '*' with isBlank true.

### Properties

- `isBlank` (boolean)
- `letter` (string, required)
  - Constraints: minLength: 1, maxLength: 1
- `points` (integer, required)
  - Constraints: minimum: 0, maximum: 12

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "boardLayout": {
      "description": "WordGrid v1 board: 13x13, 32 premium squares, center [6,6] is doubleWord.",
      "properties": {
        "premium": {
          "items": {
            "properties": {
              "col": {
                "maximum": 12,
                "minimum": 0,
                "type": "integer"
              },
              "kind": {
                "knownValues": [
                  "doubleLetter",
                  "doubleWord",
                  "tripleLetter",
                  "tripleWord"
                ],
                "type": "string"
              },
              "row": {
                "maximum": 12,
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "row",
              "col",
              "kind"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "size": {
          "type": "integer"
        }
      },
      "required": [
        "size",
        "premium"
      ],
      "type": "object"
    },
    "move": {
      "description": "One WordGrid placement turn.",
      "properties": {
        "formedWords": {
          "items": {
            "maxLength": 13,
            "type": "string"
          },
          "maxLength": 8,
          "type": "array"
        },
        "placements": {
          "items": {
            "properties": {
              "col": {
                "maximum": 12,
                "minimum": 0,
                "type": "integer"
              },
              "row": {
                "maximum": 12,
                "minimum": 0,
                "type": "integer"
              },
              "tile": {
                "ref": "#tile",
                "type": "ref"
              }
            },
            "required": [
              "tile",
              "row",
              "col"
            ],
            "type": "object"
          },
          "maxLength": 7,
          "type": "array"
        },
        "scoreClaim": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "placements",
        "formedWords",
        "scoreClaim"
      ],
      "type": "object"
    },
    "state": {
      "description": "Authoritative WordGrid board. Rack letters never appear on-ledger, only counts.",
      "properties": {
        "grid": {
          "description": "13 rows of 13 chars: A-Z placed, . empty, * wild.",
          "items": {
            "maxLength": 13,
            "minLength": 13,
            "type": "string"
          },
          "maxLength": 13,
          "minLength": 13,
          "type": "array"
        },
        "nextActor": {
          "format": "did",
          "type": "string"
        },
        "rackCount": {
          "items": {
            "properties": {
              "playerDid": {
                "format": "did",
                "type": "string"
              },
              "tileCount": {
                "maximum": 7,
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "playerDid",
              "tileCount"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "scores": {
          "items": {
            "properties": {
              "playerDid": {
                "format": "did",
                "type": "string"
              },
              "points": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "playerDid",
              "points"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "required": [
        "grid",
        "scores"
      ],
      "type": "object"
    },
    "tile": {
      "description": "One tile. Wild tiles use letter '*' with isBlank true.",
      "properties": {
        "isBlank": {
          "type": "boolean"
        },
        "letter": {
          "maxLength": 1,
          "minLength": 1,
          "type": "string"
        },
        "points": {
          "maximum": 12,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "letter",
        "points"
      ],
      "type": "object"
    }
  },
  "id": "ai.dennery.game.wordGrid",
  "lexicon": 1
}
```
