Sashité for Developers
  1. Sashité for Developers
  2. Specifications
  3. LCN
  4. 1.0.0

Location Condition Notation (LCN) Specification


Overview

Location Condition Notation (LCN) is a rule-agnostic, JSON-based format for describing location conditions in abstract strategy board games. LCN provides a standardized way to express constraints on board locations, defining what states specific locations should have.

LCN is a foundational specification designed to be used by other formats that require location state definitions.


Terminology

For complete definitions of terms used in this document, see the Glossary.

Key concepts:


Dependencies

LCN builds upon two foundational Sashité specifications:


JSON Structure

{
  "<cell-coordinate>": "<state-value>"
}

An LCN object is a JSON object where:


State Value Types

Reserved Keywords

LCN defines two reserved keywords for common location states:

Keyword Description
"empty" Location should be unoccupied
"enemy" Location should contain a piece from the opposing side

Piece Identifiers

In addition to keywords, LCN accepts QPI identifiers to specify exact piece requirements:

Type Summary

<state-value> ::= <keyword> | <qpi-identifier>
<keyword> ::= "empty" | "enemy"
<qpi-identifier> ::= /* As defined in QPI specification */

Context Dependency

Reference Piece Requirement

The keyword "enemy" is context-dependent and requires a reference piece for interpretation. The consuming specification must provide:

  1. Reference piece identification: Which piece determines the perspective
  2. Side determination logic: How the reference piece’s side is established
  3. Enemy evaluation rules: How opposing pieces are identified

Evaluation Semantics

Given a reference piece with side S, the state values evaluate as follows:

State Value Evaluates True When
"empty" Location contains no piece
"enemy" Location contains a piece with side ≠ S
QPI identifier Location contains exactly that piece

Note: The consuming specification is responsible for defining how the reference piece is determined and how side relationships are established.


Format Examples

Basic Conditions

{
  "e4": "empty"
}

Single location must be unoccupied.

{
  "f5": "enemy"
}

Single location must contain an opposing piece.

Multiple Conditions

{
  "b2": "empty",
  "c3": "empty",
  "d4": "enemy"
}

Multiple location constraints.

Specific Piece Requirements

{
  "h1": "C:+R",
  "e1": "C:+K"
}

Exact pieces required at specific locations.

Mixed Constraints

{
  "f1": "empty",
  "g1": "empty",
  "h1": "C:+R"
}

Combination of empty locations and specific pieces.

Empty Conditions

{}

No conditions - all location states are acceptable.


Validation Requirements

Structural Validation

Format Validation

Semantic Validation


Usage Patterns

Path Verification

{
  "b2": "empty",
  "c3": "empty",
  "d4": "empty"
}

Checking that intermediate locations are clear.

Capture Requirements

{
  "e5": "enemy"
}

Requiring an opponent piece at the target location.

Special Move Conditions

{
  "f1": "empty",
  "g1": "empty",
  "h1": "C:+R"
}

Complex conditions for special moves like castling.

File/Rank Restrictions

{
  "e1": "S:P",
  "e2": "S:P",
  "e3": "S:P"
}

Checking for specific piece distributions.


Integration Guidelines

For Consuming Specifications

Specifications that use LCN should:

  1. Define reference context: Clearly specify how reference pieces are determined
  2. Specify composition logic: Define how multiple conditions are combined (AND, OR, etc.)
  3. Document constraints: Explain any usage restrictions or requirements
  4. Provide examples: Show LCN usage within the consuming specification’s context

Common Integration Patterns


Design Properties


JSON Schema

Schema URL: https://sashite.dev/schemas/lcn/1.0.0/schema.json


Examples

See LCN Examples for practical implementation guidance.


Reference Implementations

Ruby