Skip to content

Instantly share code, notes, and snippets.

@nhajratw
Created November 3, 2012 15:57
Show Gist options
  • Save nhajratw/4007724 to your computer and use it in GitHub Desktop.
Save nhajratw/4007724 to your computer and use it in GitHub Desktop.
Reversing an array
puts 'What are your favorite movies?'
movies = Array.new
3.times do |index|
print "#{index + 1}: "
movies << gets
end
puts 'Your reversed movies are:'
puts movies.reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment