Пример #1
0
def readAndTestOne(filename):
    inputObj = fileToObject(filename)
    solution = solve(inputObj)
    printScore(calculateFinalScore(inputObj, solution), filename)
Пример #2
0
 def test_r2_r2_r2_r2_r2(self):
     from io import StringIO
     self.assertEqual((2, 1), solve(StringIO('R2, R2, R2, R2, R2')))
Пример #3
0
 def test(self):
     from io import StringIO
     self.assertEqual(5, solve(StringIO('zzzxxyyab-2[zxyab]\n'\
                                        'abcdefhhi-4[abcde]\n'\
                                        'abcdefghi-3[abcde]\n'))[0])
Пример #4
0
 def test_r2_l3(self):
     from io import StringIO
     self.assertEqual(5, solve(StringIO('R2, L3'))[0])
Пример #5
0
import test
import program

if __name__ == "__main__":
    inputs = test.readFiles()
    libScore = program.libScoreCombined
    # libScore = program.libScoreReversedSignup
    # libScore = program.libScoreNaive
    solutions = [program.solve(inputObj, libScore) for inputObj in inputs]
    test.printScores(inputs, solutions)
    test.submitAll(solutions)
Пример #6
0
 def test_5db3(self):
     from io import StringIO
     self.assertEqual('5DB3',
                      solve(StringIO('ULL\nRRDDD\nLURDL\nUUUUD'))[1])
Пример #7
0
 def test_1985(self):
     from io import StringIO
     self.assertEqual('1985',
                      solve(StringIO('ULL\nRRDDD\nLURDL\nUUUUD'))[0])
Пример #8
0
 def test(self):
     self.assertEqual('18f47a30', solve('abc')[0])