Skip to content

Instantly share code, notes, and snippets.

@ashleytbasinger
Created September 6, 2013 00:29
Show Gist options
  • Save ashleytbasinger/01045e256fe96a7c2c93 to your computer and use it in GitHub Desktop.
Save ashleytbasinger/01045e256fe96a7c2c93 to your computer and use it in GitHub Desktop.
anagram generator for ruby
#anagram generator
#so help me I will figure this out!
class String
def anagram
self.split(//).permutation.map { |a| a.join}
end
end
input = gets.chomp
puts input.anagram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment