
middle_out(+List, -Reordered)

   Reorder a list such that the middle elements come first

Arguments
   List                A list
   Reordered           A variable or list

Type
   library(lists)

Modes and Determinism
   middle_out(+, -) is det

Examples
   
?- middle_out([1,2,3,4,5], Zs).
Zs = [3, 2, 4, 1, 5]
Yes (0.00s cpu)

?- middle_out([1,2,3,4,5,6], Zs).
Zs = [3, 4, 2, 5, 1, 6]
Yes (0.00s cpu)
	

See Also
   reverse / 2
