Ejemplo n.º 1
0
def mk_tables_table(cursor):
    cursor.execute('CREATE TABLE IF NOT EXISTS games(name TEXT, game TEXT, seats INTEGER, level INTEGER, stakes TEXT, format TEXT)')

    # Build a database from the existing dictionary.
    for gt in tables:
        stakes = blinds.get_stakes(gt.level)
        cursor.execute("INSERT INTO games VALUES(?, ?, ?, ?, ?, ?)", (gt.tablename, gt.game, gt.seats, gt.level, stakes, 'CASH'))

    conn.commit()
Ejemplo n.º 2
0
def main_menu(session):
    """ Display the main menu """
    os.system('clear')
    print(logo())
    print('-=- Settings -=-'.center(DISPLAYWIDTH))
    print('{:15} {}'.format('Player:', player_info(session['hero'])))
    print('{:15} {}'.format('Table Name:', session['tablename']))
    print('{:15} {}'.format('Game:', session['game']))
    print('{:15} {}'.format('Stakes:', blinds.get_stakes(session['level'])))
    print('{:15} {}'.format('Seats:', session['seats']))
    print('-=- Main Menu Options -=-'.center(DISPLAYWIDTH))
    print(menu_str())
Ejemplo n.º 3
0
def mk_tables_table(cursor):
    cursor.execute(
        'CREATE TABLE IF NOT EXISTS games(name TEXT, game TEXT, seats INTEGER, level INTEGER, stakes TEXT, format TEXT)'
    )

    # Build a database from the existing dictionary.
    for gt in tables:
        stakes = blinds.get_stakes(gt.level)
        cursor.execute(
            "INSERT INTO games VALUES(?, ?, ?, ?, ?, ?)",
            (gt.tablename, gt.game, gt.seats, gt.level, stakes, 'CASH'))

    conn.commit()
Ejemplo n.º 4
0
def get_buyin(game, hero):
    minbuyin = blinds.stakes[game.level] * 10
    if hero.bank < minbuyin:
        print('Sorry, you don\'t have enough chips to buyin to this game!')
        return None
    print('The minimum buy-in for {} is {} bits.'.format(
        blinds.get_stakes(game.level), minbuyin))

    while True:
        print('How much do you want to buyin for? (Minimum={})'.format(minbuyin))

        choice = prompt()
        if numtools.is_integer(choice):
            if int(choice) < minbuyin:
                print('Not enough!\n')
            elif int(choice) > hero.bank:
                print('This is more chips than you can afford!\n')
            else:
                return int(choice)
        else:
            print('Invalid input!\n')