You post my question that I ask you. ^_^
My code:
midextract[ls_List] :=
Module[{L = Length[ls], d, r},
d = Floor[L/2];
r := Extract[ls, 1 + d] /; OddQ[L];
r := Extract[ls, List /@ {d, 1 + d}] /; EvenQ[L];
r]
You post my question that I ask you. ^_^
My code:
midextract[ls_List] :=
Module[{L = Length[ls], d, r},
d = Floor[L/2];
r := Extract[ls, 1 + d] /; OddQ[L];
r := Extract[ls, List /@ {d, 1 + d}] /; EvenQ[L];
r]