예제 #1
0
 def test_diagonalCheck(self):
     A, B = (0, 0), (1, 1)
     self.assertTrue(ttt.diagonalCheck(A, B))
     self.assertTrue(ttt.diagonalCheck(B, A))
     A = (-1, -1)
     self.assertTrue(ttt.diagonalCheck(A, B))
     A, B = (1, -1), (-1, 1)
     self.assertTrue(ttt.diagonalCheck(A, B))
     A, B = (0, 1), (-1, 1)
     self.assertFalse(ttt.diagonalCheck(A, B))
     A, B = (-1, 1), (-1, -1)
     self.assertFalse(ttt.diagonalCheck(A, B))
     A, B = (0, 0, 0), (1, 1, 1)
     self.assertTrue(ttt.diagonalCheck(A, B))
     A, B = (-1, -1, -1), (1, 1, 1)
     self.assertTrue(ttt.diagonalCheck(A, B))
     A, B = (-1, 1, 1), (1, -1, 0)
     self.assertFalse(ttt.diagonalCheck(A, B))
     A, B = (-1, 0, 1), (1, 0, -1)
     self.assertTrue(ttt.diagonalCheck(A, B))
예제 #2
0
	def test_diagonalCheck(self):
		A, B = (0, 0), (1, 1)
		self.assertTrue(ttt.diagonalCheck(A, B))
		self.assertTrue(ttt.diagonalCheck(B, A))
		A = (-1, -1)
		self.assertTrue(ttt.diagonalCheck(A, B))
		A, B = (1, -1), (-1, 1)
		self.assertTrue(ttt.diagonalCheck(A, B))
		A, B = (0, 1), (-1, 1)
		self.assertFalse(ttt.diagonalCheck(A, B))
		A, B = (-1, 1), (-1, -1)
		self.assertFalse(ttt.diagonalCheck(A, B))
		A, B = (0, 0, 0), (1, 1, 1)
		self.assertTrue(ttt.diagonalCheck(A, B))
		A, B = (-1, -1, -1), (1, 1, 1)
		self.assertTrue(ttt.diagonalCheck(A, B))
		A, B = (-1, 1, 1), (1, -1, 0)
		self.assertFalse(ttt.diagonalCheck(A, B))
		A, B = (-1, 0, 1), (1, 0, -1)
		self.assertTrue(ttt.diagonalCheck(A, B))
예제 #3
0
 def test_tripleDiagonalCheck(self):
     loc1, loc2, loc3 = (1, 1), (0, 0), (-1, -1)
     aligned = ttt.diagonalCheck(loc1, loc2) and \
         ttt.diagonalCheck(loc2, loc3) and \
         ttt.diagonalCheck(loc3, loc1)
     self.assertTrue(aligned)
예제 #4
0
	def test_tripleDiagonalCheck(self):
		loc1, loc2, loc3 = (1, 1), (0, 0), (-1, -1)
		aligned = ttt.diagonalCheck(loc1, loc2) and \
				  ttt.diagonalCheck(loc2, loc3) and \
				  ttt.diagonalCheck(loc3, loc1)
		self.assertTrue(aligned)