示例#1
0
 def test_task1(self):
     self.assertEqual(task1(["s1"], list("abcde")), "eabcd")
     self.assertEqual(task1(["x3/4"], list("abcde")), "abced")
     self.assertEqual(task1(["pe/b"], list("abcde")), "aecdb")
     self.assertEqual(task1(["s1", "x3/4", "pe/b"], list("abcde")), "baedc")
     self.assertEqual(
         task1(read_moves("input.txt"), list("abcdefghijklmnop")),
         "bijankplfgmeodhc")
示例#2
0
 def test_task1(self):
     self.assertEqual(task1("{}")[1], 1)
     self.assertEqual(task1("{{{}}}")[1], 6)
     self.assertEqual(task1("{{},{}}")[1], 5)
     self.assertEqual(task1("{{{},{},{{}}}}")[1], 16)
     self.assertEqual(task1("{<a>,<a>,<a>,<a>}")[1], 1)
     self.assertEqual(task1("{{<ab>},{<ab>},{<ab>},{<ab>}}")[1], 9)
     self.assertEqual(task1("{{<!!>},{<!!>},{<!!>},{<!!>}}")[1], 9)
     self.assertEqual(task1("{{<a!>},{<a!>},{<a!>},{<ab>}}")[1], 3)
     self.assertEqual(task1(read("input.txt"))[1], 10800)
示例#3
0
 def test_task2(self):
     self.assertEqual(task1("<>")[0], 0)
     self.assertEqual(task1("<random characters>")[0], 17)
     self.assertEqual(task1("<<<<>")[0], 3)
     self.assertEqual(task1("<{!>}>")[0], 2)
     self.assertEqual(task1("<!!>")[0], 0)
     self.assertEqual(task1("<!!!>>")[0], 0)
     self.assertEqual(task1('<{o"i!a,<{i<a>')[0], 10)
     self.assertEqual(task1(read("input.txt"))[0], 4522)
示例#4
0
 def test_task1(self):
     self.assertEquals(task1(get_map("test.txt")), 6)
     self.assertEquals(task1(get_map("input.txt")), 130)
示例#5
0
 def test_task1(self):
     self.assertEqual(task1([0, 3, 0, 1, -3]), 5)
     self.assertEqual(task1(read_input()), 343467)
示例#6
0
 def test_task1(self):
     self.assertEqual(task1("flqrgnkx"), 8108)
     self.assertEqual(task1("ljoxqyyw"), 8316)
示例#7
0
 def test_task1(self):
     self.assertEqual(task1("example.txt"), "tknk")
     self.assertEqual(task1("input.txt"), "rqwgj")
示例#8
0
 def test_task1(self):
     self.assertEqual(task1(3, 2017), 638)
     self.assertEqual(task1(328, 2017), 1670)
示例#9
0
 def test_task1(self):
     self.assertEquals(task1("ne,ne,ne".split(",")), 3)
     self.assertEquals(task1("ne,ne,sw,sw".split(",")), 0)
     self.assertEquals(task1("ne,ne,s,s".split(",")), 2)
     self.assertEquals(task1("se,sw,se,sw,sw".split(",")), 3)
     self.assertEquals(task1(read("input.txt")), 773)
示例#10
0
 def test_task1(self):
     self.assertEqual(task1("test.txt"), 1)
     self.assertEqual(task1("input.txt"), 6611)
示例#11
0
 def test_task1(self):
     self.assertEqual(task1("test.txt"), ("ABCDEF", 38))
     self.assertEqual(task1("input.txt"), ("VEBTPXCHLI", 18702))
示例#12
0
 def test_task1(self):
     self.assertEquals(task1(), 386)
示例#13
0
 def test_task1(self):
     self.assertEqual(task1(5, [3, 4, 1, 5]), 12)
     self.assertEqual(task1(256, read("input.txt")), 4114)
示例#14
0
 def test_task1(self):
     self.assertEqual(task1([0, 2, 7, 0]), 5)
     self.assertEqual(task1(read_input()), 4074)
示例#15
0
 def test_task1(self):
     self.assertEqual(task1(65, 8921, 5), 1)
     self.assertEqual(task1(65, 8921, 40 * 1000 * 1000), 588)
     self.assertEqual(task1(722, 354, 40 * 1000 * 1000), 612)