f = -> a {a.each_cons(2).map {|b, c| c - b}}p f.([3, 1, 4, 1, 5, 9, 2, 6, 5])
Standard input is empty
[-2, 3, -3, 4, 4, -7, 4, -1]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!