{
  "$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
}
