Esempio n. 1
0
	def test_addConnectionPointsToWays_noWays(self):
		board = Board.parse(TestLinks1)
		solver = Solve(board)
		points = [ # No logic connection, it's only ways
			[(1,2), (2,3)],
			[(0,1), (3,1)],
			[(3,1), (1,2)]
		]
		solver.addConnectionPointsToWays(points)
		self.assertEqual(
			solver.Ways,
			[
				[(0,1), (3,1), (1,2), (2,3)]
			]
		)
Esempio n. 2
0
	def test_addConnectionPointsToWays_withWays(self):
		board = Board.parse(TestLinks1)
		solver = Solve(board)
		points = [
			[(1,2), (1,1)],
			[(0,1), (2,2)],
			[(3,3), (2,0)],
		]
		solver.Ways = [
			[(1,3), (2,3), (1,0), (0,1)],
			[(3,0), (3,1), (3,2), (3,3)]
		]
		solver.addConnectionPointsToWays(points)
		self.assertEqual(
			solver.Ways,
			[
				[(1,3), (2,3), (1,0), (0,1), (2,2)],
				[(3,0), (3,1), (3,2), (3,3), (2,0)],
				[(1,2), (1,1)]
			]
		)