POST 28: CASINOMAD

Today I made a Slot machine

symbols = ["šŸ’", "šŸ‹", "šŸ””", "šŸ’Ž", "7", "šŸ€"]

This is the code for the Symbols

while True:


    spin = random.choices(symbols, k=3)


    print("\nSpinning...")
    print(f"\n| {spin[0]} | {spin[1]} | {spin[2]} |")

This is the code for the spinning

    if spin[0] == spin[1] == spin[2]:
        print("\nšŸŽ‰ JACKPOT! All three match!")
    elif spin[0] == spin[1] or spin[0] == spin[2] or spin[1] == spin[2]:
        print("\n✨ Two symbols match! Not bad!")
    else:
        print("\nšŸ™ No match. Try again!")

This is the code that sees if you won

    choice = input("\nPlay again? (y/n): ").strip().lower()
    if choice != 'y':
        print("\nThanks for playing! šŸŽ²")
        break

This is the code that allows you to play again

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top