Go Fish Game unfinished

 avatar
DillFire55
python
a month ago
1.6 kB
0
Indexable
Never
import random

deck = ["♠1", "♠2", "♠3", "♠4", "♠5", "♠6", "♠7", "♠8", "♠9", "♠10", "♠J", "♠Q", "♠K", "♠A", "♥1", "♥2", "♥3", "♥4", "♥5", "♥6", "♥7", "♥8", "♥9", "♥10", "♥J", "♥Q", "♥K", "♥A", "♦1", "♦2", "♦3", "♦4", "♦5", "♦6", "♦7", "♦8", "♦9", "♦10", "♦J", "♦Q", "♦K", "♦A", "♣1", "♣2", "♣3", "♣4", "♣5", "♣6", "♣7", "♣8", "♣9", "♣10", "♣J", "♣Q", "♣K", "♣A"]

random.shuffle(deck)

discard = []

p1 = []
p2 = []
com = []

p1_matches = ""
p2_matches = ""
com_matches = ""

temp = ""

while True:
    gamemode = input("Enter gamemode (1 for Player vs Player or 2 for Player vs Computer): ")
    if gamemode.lower() == "1" or gamemode.lower() == "2":
        break

if gamemode.lower() == "1":
    print("unfinished")

if gamemode.lower() == "2":
    for i in range(7):
        temp = random.choice(deck)
        
        p1.append(temp)
        deck.remove(temp)

        temp = random.choice(deck)
        
        p2.append(temp)
        deck.remove(temp)

    print("")
    
    print("Your cards: ", end='')
    for i in range(7):
        print(p1[i], end=' ')
        
    print("")

    print("Your matches: ", end='')
    for i in range(len(p1_matches)):
        print(p1_matches[i], end = '')

    print("")
    print("")
    print("Computer cards: *# *# *# *# *# *# *#")
    print("Computer matches: ", end='')
    for i in range(len(com_matches)):
        print(com_matches[i], end = '')
Leave a Comment