The objective of this lab is to create the beginnings for a python-based card game. We DO NOT expect a fully functioning card game. What we do expect is that you create a main function and various...

The objective of this lab is to create the beginnings for a python-based card game. We DO NOT expect a fully functioning card game. What we do expect is that you create a main function and various functions that will accomplish the following goals: Build a single-dimension array to keep track of the location of every card DO NOT move cards around... Just use the array to keep track of where each card is All card data is really integers - Use other arrays to translate integers to suits, ranks, and player names All cards will start in the DECK Write a function that translates a card number to a card name. HINT - look at the suit Name and rank Name arrays Write a function to assign a card to a given player Dealing a card involves picking a card number and assigning a new location to the corresponding element of card Loc Write a function that displays the location of every card. (Early versions should show numeric values for the card number and location. Later versions can include string values for prettier output.) Write a function that prints the name of every card in a given hand I have been given this starter python code

""" cardGame.py


    basic card game framework


    keeps track of card locations for as many hands as needed


"""


from random import *


NUMCARDS = 52


DECK = 0


PLAYER = 1


COMP = 2


Card Loc = [0] * NUMCARDS


Suit Name = ("hearts", "diamonds", "spades", "clubs")


Rank Name = ("Ace", "Two", "Three", "Four", "Five", "Six", "Seven",


 "Eight", "Nine", "Ten", "Jack", "Queen", "King")


Player Name = ("deck", "player", "computer")


 def main():


  clear Deck() for i in range(5):


    assign Card(PLAYER)


    assign Card(COMP)


  show Deck()


  show Hand(PLAYER)


  show Hand(COMP)


Here is sample output


Location of all cards


#        card            location


0    Ace of hearts       deck


1    Two of hearts       computer


2    Three of hearts     deck


3    Four of hearts      deck


4    Five of hearts      deck


5    Six of hearts       player


6    Seven of hearts     deck


7    Eight of hearts     player


8    Nine of hearts      computer


9    Ten of hearts       deck


10   Jack of hearts      deck


11   Queen of hearts     deck


12   King of hearts      deck


13   Ace of diamonds     deck


14   Two of diamonds     deck


15   Three of diamonds   deck


16   Four of diamonds    deck


17   Five of diamonds    deck


18   Six of diamonds     deck


19   Seven of diamonds   deck


20   Eight of diamonds   deck


21   Nine of diamonds    deck


22   Ten of diamonds     computer


23   Jack of diamonds    deck


24   Queen of diamonds   deck


25   King of diamonds    deck


26   Ace of spades       deck


27   Two of spades       deck


28   Three of spades     deck


29   Four of spades      deck


30   Five of spades      deck


31   Six of spades       deck


32   Seven of spades     player


33   Eight of spades     deck


34   Nine of spades      deck


35   Ten of spades       deck


36   Jack of spades      deck


37   Queen of spades     deck


38   King of spades      deck


39   Ace of clubs        deck


40   Two of clubs        deck


41   Three of clubs      deck


42   Four of clubs       deck


43   Five of clubs       deck


44   Six of clubs        deck


45   Seven of clubs      deck


46   Eight of clubs      deck


47   Nine of clubs       computer


48   Ten of clubs        computer


49   Jack of clubs       player


50   Queen of clubs      player


51   King of clubs       deck


Displaying player hand: Six of hearts


Eight of hearts


Seven of spades


Jack of clubs


Queen of clubs


Displaying computer hand:


Two of hearts


Nine of hearts


Ten of diamonds


Nine of clubs


Ten of clubs


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here