Created
September 6, 2013 00:29
-
-
Save ashleytbasinger/01045e256fe96a7c2c93 to your computer and use it in GitHub Desktop.
anagram generator for ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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