예제 #1
0
def create_game():
    game = Game()
    player_1 = request.form.get('player_1_name')
    player_2 = request.form.get('player_2_name')
    player_3 = request.form.get('player_3_name')
    player_4 = request.form.get('player_4_name')
    player_5 = request.form.get('player_5_name')
    player_6 = request.form.get('player_6_name')
    players = [
        i
        for i in [player_1, player_2, player_3, player_4, player_5, player_6]
        if i and i != ""
    ]
    game.start_game(players)
    game_id = db.save_game_state(None, game.get_state(),
                                 datetime.datetime.now())
    return redirect(url_for("view", game_id=game_id))
예제 #2
0
def start():
    game = Game()
    game.get_a_random_fruit()
    game.mount_tip()
    game.start_game()