コード例 #1
0
ファイル: main.py プロジェクト: tyrostone/ScrabbleSolver
def main(rack):
    s = ScrabbleSolver(rack)
    print s.score()
コード例 #2
0
ファイル: test.py プロジェクト: tyrostone/ScrabbleSolver
 def test_highest_score_multiple_option(self):
     s = ScrabbleSolver('set')
     highest = s.score()
     self.assertEqual('3, set', highest)
コード例 #3
0
ファイル: test.py プロジェクト: tyrostone/ScrabbleSolver
 def test_highest_score_one_option(self):
     s = ScrabbleSolver('aa')
     highest = s.score()
     self.assertEqual('2, aa', highest)
コード例 #4
0
ファイル: test.py プロジェクト: tyrostone/ScrabbleSolver
 def test_multiple_valid_words_in_rack(self):
     s = ScrabbleSolver('set')
     s.check_rack_for_valid_words()
     self.assertEqual(['ES', 'EST', 'ET', 'SET', 'ST', 'TE', 'TES'],
                      s.valid_rack_words)
コード例 #5
0
ファイル: test.py プロジェクト: tyrostone/ScrabbleSolver
 def test_one_valid_word_in_rack(self):
     s = ScrabbleSolver('aa')
     s.check_rack_for_valid_words()
     self.assertEqual(['AA'], s.valid_rack_words)
コード例 #6
0
ファイル: test.py プロジェクト: tyrostone/ScrabbleSolver
 def test_no_valid_words_in_rack(self):
     s = ScrabbleSolver('zz')
     s.check_rack_for_valid_words()
     self.assertEqual([], s.valid_rack_words)