Exemple #1
0
 def __init__(self):
     self.theDeck = BJ_card.deck() #the deck
     self.theLeft = BJ_card.deck() #put all used card here
     self.theDeck.generate()       
     self.theDeck.shuffle()
     self.theDealer = BJ_player.dealer("dealer")
     self.userList = []
     self.again = True  #check there are player left at the beggining of each round
     self.round = 0
Exemple #2
0
module_path = 'C:\\Users\\Tan\\Dropbox\\black_jack'
module_path1 = 'C:\\Users\\Rick L Tan\\black_jack'

if '' in sys.path:
    sys.path.remove('')

for path in [module_path,module_path1]:
    if path not in sys.path:
        sys.path.append(path)

import BJ_card, BJ_player, BJ_game

# main program here  
print ("$o$ welcome to the game that could make you the richest man in the world!")
thisGame = BJ_game.BJ_game()
system = BJ_player.player("System")
player_num = thisGame.ask_number("How many players",2,5)

for num in range(player_num):
    name = system.answer("Player Name:")
    curplayer = BJ_player.player(name)
    if num == 0:
        player1 = curplayer
    elif num == 1:
        player2 = curplayer
    elif num == 2:
        player3 = curplayer
    elif num == 3:
        player4 = curplayer
    elif num == 4:
        player5 = curplayer