Card Game In Python
import random
dict = {'A':4,'KING':4,'QUEEN':4, 'J':4}
ROWS = 3
COLS = 3
def sequence_game(alhp,rows,cols):
all_cards = []
for i, dict in alhp.items():
for _ in range(dict):
all_cards.append(i)
user_input = input("do you want to play ? ")
if user_input == 'y':
print(f"all_cards : {all_cards}")
random_choice = []
for col in range(cols):
value = random.choice(all_cards)
all_cards.remove(value)
random_choice.append(value)
lets_distribute_all_cards = input(" ready to distribute ? ")
if lets_distribute_all_cards == 'y':
print(random_choice)
if random_choice[0]==random_choice[1]==random_choice[2]:
print("you won the game")
sequence_game(dict,ROWS,COLS)
Comments
Post a Comment