p (1..10).each_slice(2).flat_map(&:reverse)
Standard input is empty
[2, 1, 4, 3, 6, 5, 8, 7, 10, 9]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!