apply method
Aplies n
times the Algorithm to cube
.
Implementation
Cube apply(
Cube cube, {
int n = 1,
void Function(Cube cube, Move move, int step, int total)? onProgress,
}) {
for (var i = 0, c = 1; i < n; i++) {
for (var k = 0; k < length; k++, c++) {
final move = this[k];
cube = cube.move(move);
onProgress?.call(cube, move, c, length * n);
}
}
return cube;
}