def can_play(candidate_card, top_card):
    # This function takes a candidate_card and a top_card and determines 
    # whether candidate_card can be played on top_card. The function returns 
    # True if it can and false otherwise

    # Write your code below!
    pass

def run_tests():
    # Below is the list of tests that we will run against your can_play function
    # Each test is on its own line and has the format:
    #   (candidate_card, top_card, expected)
    tests = [
        ((2, 'red'), (2, 'red'), True),
        (('skip', 'blue'), ('skip', 'blue'), True), 
        (('reverse', 'yellow'), ('reverse', 'yellow'), True), 
        (('+2', 'green'), ('+2', 'green'), True),
        ((2, 'red'), (5, 'red'), True),
        (('reverse', 'green'), (3, 'green'), True),
        ((5, 'blue'), ('+2', 'blue'), True),
        (('skip', 'yellow'), ('reverse', 'yellow'), True),
        ('wild', (5, 'red'), True),
        ('+4', ('+2', 'green'), True),
        ('+4', 'wild', True),
        ('wild', '+4', True),
        ((3, 'red'), (2, 'green'), False), 
        ((2, 'green'), (3, 'red'), False), 
        ((0, 'red'), (5, 'blue'), False), 
        ((4, 'red'), (9, 'yellow'), False), 
        ((1, 'green'), (2, 'blue'), False),
        ((7, 'green'), (4, 'yellow'), False),
        ((8, 'blue'), (4, 'yellow'), False),
        (('skip', 'red'), ('reverse', 'blue'), False)
    ]

    # Run all tests
    passed_tests = []
    failed_tests = []
    for test in tests:
        candidate_card, top_card, expected = test

        if can_play(candidate_card, top_card) == expected:
            passed_tests.append(test)
        else:
            failed_tests.append(test)

    # Below this is some output that handles the test results
    # Feel free to take a look at this if you are interested!

    # These are special characters that change the color of your output 
    GREEN = '\033[92m'
    RED = '\033[91m'
    ENDC = '\033[0m'

    # Next, we find out some information about the number of tests in each category
    num_tests = len(tests)
    num_passed = len(passed_tests)
    num_failed = len(failed_tests)

    # If there are failed tests, we want to provide more information about them
    if num_failed > 0:
        print("=" * 70)
        print("Failed Tests".center(70))
        print("=" * 70)
        for test in failed_tests:
            candidate_card, top_card, expected = test
            if expected == True:
                print(f"You should be able to place a {candidate_card} on a {top_card}.")
            else:
                print(f"You should not be able to place a {candidate_card} on a {top_card}.")

    # Finally, we want to print a summary
    print("=" * 70)
    print("Summary".center(70))
    print("=" * 70)
    print(GREEN + "Tests passed: "+ str(num_passed) + "/" + str(num_tests) + ENDC)
    
    if num_failed > 0:
        print(RED + "Tests failed: " + str(num_failed) + "/" + str(num_tests) + ENDC)

    if num_passed == num_tests:
        print(GREEN + "Congratulations! You passed all tests!" + ENDC)

run_tests()
