Guest User

Untitled

a guest
Feb 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.09 KB | None | 0 0
  1. a = [1, 2, 3, 4, 5, 6, 7, 8]
  2. b = []
  3. 0.step(a.size, 2) { |i| b << [a[i], a[i+1]] }
  4. p a, b
Add Comment
Please, Sign In to add comment