riffleInList<T> function

List<T> riffleInList<T>(
  1. Iterable<T> it
)

Split in half, interleave second half first.

Implementation

List<T> riffleInList<T>(Iterable<T> it) {
  if (it.isEmpty) {
    return [];
  }
  return interleaveList(it.toList().sublist(it.length ~/ 2),
      it.toList().sublist(0, it.length ~/ 2));
}