Files
project_game/card.py

20 lines
678 B
Python

#module defines the value of the card.
#the cards in blackjack have a range in value from 1-10 with a face card being worth 10 and an ace being worth 1 or 11 depending on what you choose it to be worth.
from random import randint
class Card:
def __init__(self):
self.deal()
def __str__(self):
return str(self.face)
def deal(self):
self.face = randint(1, 11)
#I think here we should return 1-13 to include ace and face cards.
#This will make checking if 4 of a kind have been dealt easier.
#THEN when it comes to scoring we can use the value to calculate face cards as 10 points.
return self.face