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

LCN Examples

Essential implementation guide for Location Condition Notation v1.0.0.


Basic Keywords

Empty Locations

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

Requires locations b2 and c3 to be unoccupied.

Enemy Pieces

{
  "e5": "enemy"
}

Requires location e5 to contain a piece from the opposing side (relative to a reference piece).


QPI Identifiers

Specific Piece Requirements

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

Requires specific pieces at exact locations (e.g., for validating special move conditions).

Mixed Constraints

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

Combines empty locations with specific piece requirements.


Condition Patterns

Single Condition

{
  "e4": "empty"
}

A single location constraint.

Multiple Conditions

{
  "a2": "empty",
  "a3": "empty",
  "a4": "enemy"
}

Multiple location constraints that can be evaluated together.

Complex Piece Patterns

{
  "e1": "S:P",
  "e2": "S:P",
  "e3": "S:P",
  "e5": "S:P",
  "e6": "S:P",
  "e7": "S:P",
  "e8": "S:P",
  "e9": "S:P"
}

Checking for multiple instances of the same piece type across different locations.


Common Usage Patterns

Path Clearance

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

Verifying that a path between locations is clear.

Capture Conditions

{
  "f5": "enemy"
}

Checking if a location contains an opponent’s piece.

Special Move Validation

Castling setup:

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

En passant conditions:

{
  "f6": "empty",
  "f5": "c:-p"
}

Combining multiple conditions for special moves.


Logical Composition

LCN conditions can be composed in different ways depending on the consuming specification:

Conjunction (AND logic)

When all conditions must be satisfied:

{
  "e4": "empty",
  "e5": "enemy"
}

Both e4 must be empty AND e5 must contain an enemy.

Disjunction (OR logic via negation)

When any condition triggers a constraint:

{
  "e4": "empty",
  "e5": "enemy"
}

Constraint triggered if e4 is empty OR e5 contains an enemy.

Expressing Implicit Conditions

Through negation patterns, additional conditions can be expressed:

Requiring allied pieces (via negation):

{
  "a1": "enemy"
}

When negated: “not enemy at a1” implies allied piece or empty.

Requiring occupied locations (via negation):

{
  "b7": "empty"
}

When negated: “not empty at b7” implies any piece present.


Game-Specific Applications

Chess Patterns

Rook movement path:

{
  "a2": "empty",
  "a3": "empty"
}

Diagonal capture:

{
  "f5": "enemy"
}

Shōgi Patterns

Drop restrictions:

{
  "e4": "empty"
}

File checking:

{
  "e1": "S:P",
  "e2": "S:P",
  "e3": "S:P",
  "e5": "S:P",
  "e6": "S:P",
  "e7": "S:P",
  "e8": "S:P",
  "e9": "S:P"
}

Xiangqi Patterns

Cannon jump validation:

{
  "b7": "empty"
}

When negated, ensures b7 is occupied (the screen piece for cannon capture).


Empty Object

{}

No conditions - all location states are acceptable. Used when no environmental constraints apply.


Reference Context

The "enemy" keyword requires a reference piece for evaluation. The consuming specification must provide this context. For example:

The side component (uppercase/lowercase) of the reference piece’s QPI determines the perspective for enemy evaluation.