find method

List<int>? find(
  1. bool f(
    1. NodeOutput
    )
)

Implementation

List<int>? find(bool Function(NodeOutput) f) {
  List<int>? result;
  this.s.asMap().entries.any((rowEntry) {
    var y = rowEntry.key;
    var row = rowEntry.value;
    return row.asMap().entries.any((columnEntry) {
      var x = columnEntry.key;
      var cell = columnEntry.value;
      if (cell == null) return false;
      if (cell.all.any((c) => f(c))) {
        result = [x, y];
        return true;
      }
      return false;
    });
  });
  return result;
}