decode method

dynamic decode(
  1. dynamic id
)

Given an ID, returns the starting position's arrangement of pieces.

see {@link https://en.wikipedia.org/wiki/Fischer_Random_Chess_numbering_scheme}

param id An ID of a starting position returns The starting position's arrangement, or false if invalid ID

Implementation

dynamic decode(id) {
    if (!FischerRandomValidators().isValidID(id)) return false;
    return POSITIONS[int.parse(id.toString())];
  }