def main():
    print("\t\tWelcome to War!\n")
    names = []
    for i in range(2):
        name = input(f"Enter player {i + 1}'s name: ")
        names.append(name)

    again = None

    while again != "n":
        game = WarGame(names)
        game.play()
        again = G.askYesNo("\nDo you want to play again? (Y/N)")
Exemple #2
0
def main():
    print("\nWelcome to the Python Highest Card game.\n")
    names = []
    number = Games.askForNumber("How many players? (2-7): ", low=2, high=8)
    print()
    i = 1
    for i in range(number):
        name = input("Enter player name: ")
        if name == "":
            names.append("Anon")
            print()
            i += 1
        else:
            names.append(name)
            print()
            i += 1
    game = Highest_Game(names)
    again = "Y"
    while again == "y" or again == "Y":
        game.play()
        again = Games.askYesNo("\nDo you want to play again?: ")