Exemplo n.º 1
0
def test_manhattan__ko_3():
	"""
		test manhattan some unvalid anwer, with many change
	"""
	exemple = []
	for i in range(1, 3*3+1):
		exemple.append(i)
	assert functions.manhattan(
		3,
		[4, 6, 2, 9, 8, 3, 1, 5, 7],
		[1, 2, 3, 4, 5, 6, 7, 8, 9]
	) == 11
Exemplo n.º 2
0
def test_manhattan__ok_1():
	"""
		test manhattan some valid anwer, with swall puzzle
	"""
	exemple = []
	for i in range(1, 2*2+1):
		exemple.append(i)
	assert functions.manhattan(
		2,
		exemple,
		exemple
	) == 0
Exemplo n.º 3
0
def test_manhattan__ok_3():
	"""
		test manhattan some valid anwer, with big puzzle
	"""
	exemple = []
	for i in range(1, 12*12+1):
		exemple.append(i)
	assert functions.manhattan(
		12,
		exemple,
		exemple
	) == 0
Exemplo n.º 4
0
def test_manhattan__ko_2():
	"""
		test manhattan some unvalid anwer, with a far change
	"""
	exemple = []
	for i in range(1, 3*3+1):
		exemple.append(i)
	assert functions.manhattan(
		3,
		[9, 2, 3, 4, 5, 6, 7, 8, 1],
		[1, 2, 3, 4, 5, 6, 7, 8, 9]
	) == 4
Exemplo n.º 5
0
def test_manhattan__ok_2():
	"""
		test manhattan some valid anwer, with medium puzzle
	"""
	exemple = []
	for i in range(1, 5*5+1):
		exemple.append(i)
	assert functions.manhattan(
		5,
		exemple,
		exemple
	) == 0