Hi, I have some mistake on test 3, 5, and 7, but I don’t understand why (for the 3).
I create unit test for every case, and there are OK. So I create unit test for test 3 : all the 34 step I have, and I don’t undestand why the test 3 is make in 56 step and not in 34 step.
Can anyone help me find the error?
class TestBataille(unittest.TestCase):
def test_round_battle_step_1(self):
cards1 = ['6H', '7H', '6C', 'QS', '7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
cards2 = ['JH', 'AH', 'KD', 'AD', '9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H']
expected1 = ['7H', '6C', 'QS', '7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
expected2 = ['AH', 'KD', 'AD', '9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_round_battle_step_2(self):
cards1 = ['7H', '6C', 'QS', '7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
cards2 = ['AH', 'KD', 'AD', '9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H']
expected1 = ['6C', 'QS', '7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
expected2 = ['KD', 'AD', '9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_round_battle_step_3(self):
cards1 = ['6C', 'QS', '7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
cards2 = ['KD', 'AD', '9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H']
expected1 = ['QS', '7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
expected2 = ['AD', '9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C']
def test_round_battle_step_4(self):
cards1 = ['QS', '7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
cards2 = ['AD', '9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C']
expected1 = ['7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
expected2 = ['9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS']
def test_round_battle_step_5(self):
cards1 = ['7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
cards2 = ['9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS']
expected1 = ['8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
expected2 = ['2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S']
def test_round_battle_step_6(self):
cards1 = ['8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
cards2 = ['2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S']
expected1 = ['6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D']
expected2 = ['2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S']
def test_round_battle_step_7(self):
cards1 = ['6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D']
cards2 = ['2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S']
expected1 = ['5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S']
def test_round_battle_step_8(self):
cards1 = ['5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S']
expected1 = ['6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S']
def test_round_battle_step_9(self):
cards1 = ['6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S']
expected1 = ['QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S']
def test_round_battle_step_10(self):
cards1 = ['QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S']
expected1 = ['4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH']
def test_round_battle_step_11(self):
cards1 = ['4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH']
expected1 = ['3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D']
def test_round_battle_step_12(self):
cards1 = ['3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D']
expected1 = ['7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S']
def test_round_battle_step_13(self):
cards1 = ['7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S']
expected1 = ['3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C']
def test_round_battle_step_14(self):
cards1 = ['3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C']
expected1 = ['4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C']
def test_round_battle_step_15(self):
cards1 = ['4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C']
expected1 = ['5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S']
def test_round_battle_step_16(self):
cards1 = ['5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S']
expected1 = ['QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H']
def test_round_battle_step_17(self):
cards1 = ['QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H']
expected1 = ['5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD']
def test_round_battle_step_18(self):
cards1 = ['5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD']
expected1 = ['3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C']
def test_round_battle_step_19(self):
cards1 = ['3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C']
expected1 = ['3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H']
def test_round_battle_step_20(self):
cards1 = ['3D', '8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['8S', '2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H']
expected1 = ['8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
expected2 = ['2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D']
def test_round_battle_step_21(self):
cards1 = ['8C', '4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H']
cards2 = ['2S', '10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D']
expected1 = ['4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H', '8C', '2S']
expected2 = ['10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D']
def test_round_battle_step_22(self):
cards1 = ['4H', '4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H', '8C', '2S']
cards2 = ['10H', '8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D']
expected1 = ['4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H', '8C', '2S']
expected2 = ['8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H']
def test_round_battle_step_23(self):
cards1 = ['4C', 'QC', '5D', '7D', '8D', '2D', '6D', '2H', '8C', '2S']
cards2 = ['8H', 'AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H']
expected1 = ['QC', '5D', '7D', '8D', '2D', '6D', '2H', '8C', '2S']
expected2 = ['AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C']
def test_round_battle_step_24(self):
cards1 = ['QC', '5D', '7D', '8D', '2D', '6D', '2H', '8C', '2S']
cards2 = ['AC', '2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C']
expected1 = ['5D', '7D', '8D', '2D', '6D', '2H', '8C', '2S']
expected2 = ['2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC']
def test_round_battle_step_25(self):
cards1 = ['5D', '7D', '8D', '2D', '6D', '2H', '8C', '2S']
cards2 = ['2C', '9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC']
expected1 = ['7D', '8D', '2D', '6D', '2H', '8C', '2S', '5D', '2C']
expected2 = ['9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC']
def test_round_battle_step_26(self):
cards1 = ['7D', '8D', '2D', '6D', '2H', '8C', '2S', '5D', '2C']
cards2 = ['9H', 'JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC']
expected1 = ['8D', '2D', '6D', '2H', '8C', '2S', '5D', '2C']
expected2 = ['JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D']
def test_round_battle_step_27(self):
cards1 = ['8D', '2D', '6D', '2H', '8C', '2S', '5D', '2C']
cards2 = ['JH', '6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D']
expected1 = ['2D', '6D', '2H', '8C', '2S', '5D', '2C']
expected2 = ['6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D']
def test_round_battle_step_28(self):
cards1 = ['2D', '6D', '2H', '8C', '2S', '5D', '2C']
cards2 = ['6H', 'AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D']
expected1 = ['6D', '2H', '8C', '2S', '5D', '2C']
expected2 = ['AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_round_battle_step_29(self):
cards1 = ['6D', '2H', '8C', '2S', '5D', '2C']
cards2 = ['AH', '7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D']
expected1 = ['2H', '8C', '2S', '5D', '2C']
expected2 = ['7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_round_battle_step_30(self):
cards1 = ['2H', '8C', '2S', '5D', '2C']
cards2 = ['7H', 'KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D']
expected1 = ['8C', '2S', '5D', '2C']
expected2 = ['KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_round_battle_step_31(self):
cards1 = ['8C', '2S', '5D', '2C']
cards2 = ['KD', '6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H']
expected1 = ['2S', '5D', '2C']
expected2 = ['6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H', 'KD', '8C']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_round_battle_step_32(self):
cards1 = ['2S', '5D', '2C']
cards2 = ['6C', 'AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H', 'KD', '8C']
expected1 = ['5D', '2C']
expected2 = ['AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H', 'KD', '8C', '6C', '2S']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_round_battle_step_33(self):
cards1 = ['5D', '2C']
cards2 = ['AD', 'QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H', 'KD', '8C', '6C', '2S']
expected1 = ['2C']
expected2 = ['QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H', 'KD', '8C', '6C', '2S', 'AD', '5D']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_round_battle_step_34(self):
cards1 = ['2C']
cards2 = ['QS', '9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H', 'KD', '8C', '6C', '2S', 'AD', '5D']
expected1 = []
expected2 = ['9C', '7S', 'JC', '5S', '10C', '6S', 'KC', 'QH', '10D', '4D', 'JS', '3S', 'JD', '7C', '9D', '3C', '9S', '4S', 'KS', '5H', 'AS', 'QD', 'KH', '5C', '10S', '3H', '8S', '3D', '10H', '4H', '8H', '4C', 'AC', 'QC', '9H', '7D', 'JH', '8D', '6H', '2D', 'AH', '6D', '7H', '2H', 'KD', '8C', '6C', '2S', 'AD', '5D', 'QS', '2C']
winner = round_battle(cards1, cards2)
self.assertEqual(cards1, expected1)
self.assertEqual(cards2, expected2)
self.assertEqual(winner, 2)
def test_battle(self):
cards1 = ['6H', '7H', '6C', 'QS', '7S', '8D', '6D', '5S', '6S', 'QH', '4D', '3S', '7C', '3C', '4S', '5H', 'QD', '5C', '3H', '3D', '8C', '4H', '4C', 'QC', '5D', '7D']
cards2 = ['JH', 'AH', 'KD', 'AD', '9C', '2D', '2H', 'JC', '10C', 'KC', '10D', 'JS', 'JD', '9D', '9S', 'KS', 'AS', 'KH', '10S', '8S', '2S', '10H', '8H', 'AC', '2C', '9H']
winner, number = battle(cards1, cards2)
self.assertEqual(winner, 2)
# /!\ The expected in codingame is 56
self.assertEqual(number, 34)