コード例 #1
0
def game():
    team = 'home'
    gameID = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for i in range(6))
    if request.args.get('game'):
        gameID = request.args.get('game')
        team = 'away'
    if team == 'home':
        with open(os.path.join(DATA_DIR, gameID+'.json'), 'w') as f:
            f.write(json.dumps(newGame()))
    return render_template('FlaskCheckers.html', team=team, gameID=gameID)
コード例 #2
0
ファイル: blackjack.py プロジェクト: JackJackJ/BlackJackLee
def new_game():
    global dealer_card_frame
    global player_card_frame
    global dealer_hand
    global player_hand
    BJ.newGame()
    # embedded frame to hold the card images
    dealer_card_frame.destroy()
    dealer_card_frame = tkinter.Frame(card_frame, bg="green")
    dealer_card_frame.grid(row=0, column=1, sticky='ew', rowspan=2)

    # embedded frame to hold the card images
    player_card_frame.destroy()
    player_card_frame = tkinter.Frame(card_frame, bg="green")
    player_card_frame.grid(row=2, column=1, sticky='ew', rowspan=2)

    result_text.set("")

    # Create the list to store the dealer's and player's hands
    dealer_hand = []
    player_hand = []
    initial_deal()
コード例 #3
0
ファイル: ui_tkinter.py プロジェクト: missingyouzi/PythonGame
def startGame():
    return logic.newGame()
コード例 #4
0
def evNew():
    status["text"] = "Playing the game"
    game2cells(logic.newGame())
コード例 #5
0
 def do_new(self, arg):
     self.game = logic.newGame()
     ui.playGame(self.game)
コード例 #6
0
ファイル: blackjack.py プロジェクト: JackJackJ/BlackJackLee
def play():
    BJ.newGame()
    initial_deal()
    mainWindow.mainloop()