Ejemplo n.º 1
0
    def testShiftRightRow6(self):
        col = self.ran.randint(3, 4)
        new = algo.shiftRight(6, col, 1, self.seat.copy())

        def check(old, new):
            for i in range(5):
                if new[i] != old[i]:
                    return False
            return new[5] == [0, 0, 38, 36, 37, 0, 0]

        self.assertTrue(check(self.seat, new))
Ejemplo n.º 2
0
    def testShiftRightRow1(self):
        col = self.ran.randint(1, 6)
        new = algo.shiftRight(1, col, 1, self.seat.copy())

        def check(old, new):
            for i in range(1, 6):
                if new[i] != old[i]:
                    return False
            return new[0] == [7, 1, 2, 3, 4, 5, 6]

        self.assertTrue(check(self.seat, new))
Ejemplo n.º 3
0
    def testShiftRightRow5(self):
        col = self.ran.randint(1, 6)
        new = algo.shiftRight(5, col, 1, self.seat.copy())

        def check(old, new):
            for i in range(6):
                if i != 4:
                    if new[i] != old[i]:
                        return False
            return new[4] == [35, 29, 30, 31, 32, 33, 34]

        self.assertTrue(check(self.seat, new))
Ejemplo n.º 4
0
    def testShiftRightRow4(self):
        col = self.ran.randint(1, 6)
        new = algo.shiftRight(4, col, 1, self.seat.copy())

        def check(old, new):
            for i in range(6):
                if i != 3:
                    if new[i] != old[i]:
                        return False
            return new[3] == [28, 22, 23, 24, 25, 26, 27]

        self.assertTrue(check(self.seat, new))
Ejemplo n.º 5
0
    def testShiftRightRow3(self):
        col = self.ran.randint(1, 6)
        new = algo.shiftRight(3, col, 1, self.seat.copy())

        def check(old, new):
            for i in range(6):
                if i != 2:
                    if new[i] != old[i]:
                        return False
            return new[2] == [21, 15, 16, 17, 18, 19, 20]

        self.assertTrue(check(self.seat, new))
Ejemplo n.º 6
0
    def testShiftRightRow2(self):
        col = self.ran.randint(1, 6)
        new = algo.shiftRight(2, col, 1, self.seat.copy())

        def check(old, new):
            for i in range(6):
                if i != 1:
                    if new[i] != old[i]:
                        return False
            return new[1] == [14, 8, 9, 10, 11, 12, 13]

        self.assertTrue(check(self.seat, new))
Ejemplo n.º 7
0
 def testRightBound(self):
     new = algo.shiftRight(1, 7, 1, self.seat.copy())
     self.assertEqual(self.seat, new)