def readAndTestOne(filename): inputObj = fileToObject(filename) solution = solve(inputObj) printScore(calculateFinalScore(inputObj, solution), filename)
def test_r2_r2_r2_r2_r2(self): from io import StringIO self.assertEqual((2, 1), solve(StringIO('R2, R2, R2, R2, R2')))
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])
def test_r2_l3(self): from io import StringIO self.assertEqual(5, solve(StringIO('R2, L3'))[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)
def test_5db3(self): from io import StringIO self.assertEqual('5DB3', solve(StringIO('ULL\nRRDDD\nLURDL\nUUUUD'))[1])
def test_1985(self): from io import StringIO self.assertEqual('1985', solve(StringIO('ULL\nRRDDD\nLURDL\nUUUUD'))[0])
def test(self): self.assertEqual('18f47a30', solve('abc')[0])