toUpperCase method

List<String> toUpperCase(
  1. dynamic arrangement
)

Converts an arrangement of pieces to uppercase letters.

the param arrangement A starting position's arrangement returns The same arrangement in uppercase letters, or false if invalid arrangement

Implementation

List<String> toUpperCase(dynamic arrangement) {
    //if (!isValidArrangement(arrangement)) return false;
    //String type =  arrangement.runtimeType.toString();
    List<String> converted = [];
    if (arrangement is String) {
      converted = arrangement.runes.map((e) => String.fromCharCode(e).toString().toUpperCase()).toList();
    } else {
      converted = converted.map((e) => e.toUpperCase()).toList();
    }
    return converted;
  }