Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import time
- from graphics import *
- userHV = 0
- bet = ()
- dealt=False
- uValue=[]
- AIHand=[]
- AIHV=0
- AiLength=[]
- class cards():
- # initiating cardVs
- def __init__(self):
- self.ini=['c2','c3','c4','c5','c6','c7','c8','c9','c10','cJ','cQ','cK','cA',
- 's2','s3','s4','s5','s6','s7','s8','s9','s10','sJ','sQ','sK','sA',
- 'h2','h3','h4','h5','h6','h7','h8','h9','h10','hJ','hQ','hK','hA',
- 'd2','d3','d4','d5','d6','d7','d8','d9','d10','dJ','dQ','dK','dA']
- # clearing randomized deck
- # clearing suit num and b cardVs
- # creating function deck which randomizes deck
- def deck(self):
- # while there is something in the list deck
- self.b=random.choice(self.ini)
- # appending that random cardV to list ranDeck
- self.Inplay= self.ini
- if self.b in self.ini:
- self.ini.remove(self.b)
- self.inplay=[]
- self.inplay.append(self.ini)
- # calling to method that will classify suit and number
- self.call()
- def call(self):
- if "c" in self.b:
- self.suit = "c"
- elif "s" in self.b:
- self.suit = "s"
- elif "h" in self.b:
- self.suit = "h"
- elif "d" in self.b:
- self.suit = "d"
- if "J" in self.b:
- self.num = "J"
- self.value = 10
- elif "Q" in self.b:
- self.num = "Q"
- self.value = 10
- elif "K" in self.b:
- self.num = "K"
- self.value = 10
- elif "A" in self.b:
- self.num = "A"
- self.value = 11
- else:
- self.num=self.b[1:]
- self.value = self.num
- return self.num and self.value and self.suit
- win = GraphWin("Casino", 500, 500)
- class game():
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement