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