Skip to content

Instantly share code, notes, and snippets.

@austinbv
Created August 28, 2011 22:07
Show Gist options
  • Select an option

  • Save austinbv/1177301 to your computer and use it in GitHub Desktop.

Select an option

Save austinbv/1177301 to your computer and use it in GitHub Desktop.
x = [1, 2, 3]
y = [2, 1, 1]
x.each_with_index |elem, index| do
x[index] = elem + y[index]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment