Skip to content

Instantly share code, notes, and snippets.

@domgetter
Created January 7, 2016 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domgetter/d8431c773b26a2ed6e48 to your computer and use it in GitHub Desktop.
Save domgetter/d8431c773b26a2ed6e48 to your computer and use it in GitHub Desktop.
[*"a".."h"].each_cons(2) {|(last, current)| puts "last: #{last}, current: #{current}" }
# last: a, current: b
# last: b, current: c
# last: c, current: d
# last: d, current: e
# last: e, current: f
# last: f, current: g
# last: g, current: h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment