Script takes two strings and runs a series of comparisons on them.
Description | Input | Output |
---|---|---|
It will check if strings are actual words. | 'rby', 'bury' | 'You need to input actual words!' |
It will check if strings are anagrams. | 'ruby', 'bury' | 'These words are anagrams!' |
It will check if strings are not anagrams and if not display number of letters in common. | 'mango', 'melon' | 'These words are not anagrams and have 3 letters in common!' |
It will run checks ignoring case. | 'ruBy', 'buRy' | 'These words are anagrams!' |
It will check if anagrams are also palindromes. | 'Racecar', 'racecar' | 'These words are anagrams and palindromes!' |
It will check if strings are anti-grams. | 'Kite', 'Car' | 'These words are antigrams!' |
It will remove spaces and run checks. | 'Race Car', 'racecar' | 'These words are anagrams and palindromes!' |
It will remove special characters and run checks. | 'Race Car', 'racecar!!!##@@' | 'These words are anagrams and palindromes!' |
Script offers option to check another string against original. | Would you like to check another word against 'original string'? Response: Yes | 'Type another word:' |
-
Download files here.
-
In terminal run 'anagram_check_script.rb'.
-
Follow the prompts.
If you have questions or run into any issues please email me at ([email protected])
Ruby 2.2.2 and the gems 'rspec' and 'pry'.
MIT License
Copyright (c) 2017 David Hale