예제 #1
0
    def testTouchToSolve(self):
        board.touch(self.b, (4,1))
        self.assertEqual(scoreboard(self.b), 30)

        b2 = board.newboard(
            """
            4 4 2 2 1
            0 0 2 3 4
            0 0 0 4 4
            3 0 0 3 4
            0 0 0 0 4
            3 0 0 0 3
            """)
        self.assertEquals(self.b, b2)

        board.touch(self.b, (1,4))

        b2 = board.newboard(
            """
            4 4 3 0 0
            0 0 3 0 0
            0 0 0 0 0
            4 0 0 0 0
            0 0 0 0 0
            4 0 0 0 0
            """)
        self.assertEquals(self.b, b2)

        board.touch(self.b, (0,1))

        b2 = board.newboard(
            """
            0 0 0 0 0
            0 0 4 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            """)
        self.assertEquals(self.b, b2)

        board.touch(self.b, (1,2))
        
        b2 = board.newboard(
            """
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            """)
        self.assertEquals(self.b, b2)
예제 #2
0
    def testTouchToSolve(self):
        board.touch(self.b, (4, 1))
        self.assertEqual(scoreboard(self.b), 30)

        b2 = board.newboard("""
            4 4 2 2 1
            0 0 2 3 4
            0 0 0 4 4
            3 0 0 3 4
            0 0 0 0 4
            3 0 0 0 3
            """)
        self.assertEquals(self.b, b2)

        board.touch(self.b, (1, 4))

        b2 = board.newboard("""
            4 4 3 0 0
            0 0 3 0 0
            0 0 0 0 0
            4 0 0 0 0
            0 0 0 0 0
            4 0 0 0 0
            """)
        self.assertEquals(self.b, b2)

        board.touch(self.b, (0, 1))

        b2 = board.newboard("""
            0 0 0 0 0
            0 0 4 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            """)
        self.assertEquals(self.b, b2)

        board.touch(self.b, (1, 2))

        b2 = board.newboard("""
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            0 0 0 0 0
            """)
        self.assertEquals(self.b, b2)
예제 #3
0
 def testScoreBoard(self):
     score = scoreboard(self.b)
     self.assertEqual(score, 65)
예제 #4
0
 def testScoreBoard(self):
     score = scoreboard(self.b)
     self.assertEqual(score, 65)