%i[a b c d e].each_cons 2 do |(prev, nxt)| p [prev, nxt]end
Standard input is empty
[:a, :b] [:b, :c] [:c, :d] [:d, :e]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!