« Go Back to Phase 1

At certain points, we may want to execute the same Move or Algorithm a many number of tiems (for performance or otherwise reasons).

As such, it would be nice to have a helper function ready for this need!

let rec ExecuteN cubeState transformation n =
    match n with
    | 0 -> cubeState
    | 1 -> Execute cubeState transformation
    | n when n > 1 -> ( ExecuteN cubeState transformation (n-1) ) |> Execute transformation
    | _ -> failwith "need moar n"