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)
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()
def startGame(): return logic.newGame()
def evNew(): status["text"] = "Playing the game" game2cells(logic.newGame())
def do_new(self, arg): self.game = logic.newGame() ui.playGame(self.game)
def play(): BJ.newGame() initial_deal() mainWindow.mainloop()