fork download
  1. let rec f=function|[]->[]|h::t->List.rev h@(t|>List.map List.rev|>f)
  2. [
  3. [];
  4. [[1]];
  5. [[2; 1]; [3; 4]];
  6. [[3; 2; 1]; [4; 5; 6]; [9; 8; 7]];
  7. [[4; 3; 2; 1]; [5; 6; 7; 8]; [12; 11; 10; 9]; [13; 14; 15; 16]]
  8. ] |> List.iter(f>> printfn "%A")
Success #stdin #stdout 0.06s 134592KB
stdin
Standard input is empty
stdout
[]
[1]
[1; 2; 3; 4]
[1; 2; 3; 4; 5; 6; 7; 8; 9]
[1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16]