From 1624eb01df1837e20deae0ee6e24bd5e964f87af Mon Sep 17 00:00:00 2001 From: Victoria Date: Tue, 27 Jun 2017 10:00:00 -0400 Subject: [PATCH 1/2] Anagram Done --- anagram_detector.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anagram_detector.rb b/anagram_detector.rb index f67e128..154f285 100644 --- a/anagram_detector.rb +++ b/anagram_detector.rb @@ -1,5 +1,6 @@ # Implement this in such a way that when called below, detect_anagram will result in true or false. def canonical(word) + word == word.downcase.chars.sort end def detect_anagram(word1, word2) @@ -12,5 +13,4 @@ def detect_anagram(word1, word2) p detect_anagram('pants', 'pants') == true p detect_anagram('CinEmA', 'iceman') == true p detect_anagram('defgh8', 'g8hefd') == true - - +p detect_anagram('bird', 'house') == false From 8ff4c6750fb755d83edf30098cc3e0ac49e64cf1 Mon Sep 17 00:00:00 2001 From: Victoria Date: Thu, 29 Jun 2017 08:55:27 -0400 Subject: [PATCH 2/2] Aragram Done --- anagram_detector.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/anagram_detector.rb b/anagram_detector.rb index 154f285..68c10f0 100644 --- a/anagram_detector.rb +++ b/anagram_detector.rb @@ -1,6 +1,6 @@ # Implement this in such a way that when called below, detect_anagram will result in true or false. def canonical(word) - word == word.downcase.chars.sort + word.downcase.chars.sort end def detect_anagram(word1, word2) @@ -13,4 +13,3 @@ def detect_anagram(word1, word2) p detect_anagram('pants', 'pants') == true p detect_anagram('CinEmA', 'iceman') == true p detect_anagram('defgh8', 'g8hefd') == true -p detect_anagram('bird', 'house') == false