def create_game(gm):
    '\n    Configure and create a game.\n\n    Creates a game with base settings equivalent to one of the default presets.\n    Allows user to customize the settings before starting the game.\n\n    Parameters\n    ----------\n    gm : int\n        Game type to replicate:\n            0: Normal mode.\n            1: Advanced mode.\n\n    Returns\n    -------\n    BattleshipGame\n        Game instance with user-chosen settings.\n    '
    print(('\n' * PAD_AMOUNT))
    if (gm == 0):
        Utils.box_string('Normal Mode', print_string=True)
        settings = normal_mode_preset
    elif (gm == 1):
        Utils.box_string('Advanced Mode', print_string=True)
        settings = advanced_mode_preset
    else:
        Utils.box_string('Testing Mode', print_string=True)
        settings = testing_preset
    Utils.print_settings(settings)
    if (Utils.num_input('Would you like to change the settings?', 'No', 'Yes') == 1):
        while True:
            setting = Utils.num_input('Settings', 'Grid Size', 'Ship Amount', 'Special Abilities', 'Game Type', 'Exit')
            if (setting == 0):
                settings['width'] = int(Utils.string_input('Grid Width (5-26)', condition='^[5-9]$|^1[0-9]$|^2[0-6]$'))
                settings['height'] = int(Utils.string_input('Grid Height (5-26)', condition='^[5-9]$|^1[0-9]$|^2[0-6]$'))
            elif (setting == 1):
                while True:
                    settings['5_ships'] = int(Utils.string_input('5-Long Ships (0-9)', condition='[0-9]'))
                    settings['4_ships'] = int(Utils.string_input('4-Long Ships (0-9)', condition='[0-9]'))
                    settings['3_ships'] = int(Utils.string_input('3-Long Ships (0-9)', condition='[0-9]'))
                    settings['2_ships'] = int(Utils.string_input('2-Long Ships (0-9)', condition='[0-9]'))
                    settings['1_ships'] = int(Utils.string_input('1-Long Ships (0-9)', condition='[0-9]'))
                    count = ((((settings['5_ships'] + settings['4_ships']) + settings['3_ships']) + settings['2_ships']) + settings['1_ships'])
                    if (count == 0):
                        Utils.box_string('You must have at least one ship!', print_string=True)
                    elif (count > 26):
                        Utils.box_string('You have put in too many ships! (max 26)', print_string=True)
                    elif ((((((settings['5_ships'] * 5) + (settings['4_ships'] * 4)) + (settings['3_ships'] * 3)) + (settings['2_ships'] * 2)) + settings['1_ships']) > (settings['width'] * settings['height'])):
                        Utils.box_string('Your ships will not fit inside of the board!', print_string=True)
                    else:
                        break
            elif (setting == 2):
                settings['allow_moves'] = (Utils.num_input('Ship Moving', 'Enable', 'Disable') == 0)
                if settings['allow_moves']:
                    settings['allow_mines'] = (Utils.num_input('Mines', 'Enable', 'Disable') == 0)
                settings['mine_turns'] = (int(Utils.string_input('Turns Between Mines', condition='\\d+')) if settings['allow_mines'] else None)
            elif (setting == 3):
                settings['p_type'] = ['CPU', 'Player'][Utils.num_input('Game Type', 'CPU', 'Player')]
            Utils.print_settings(settings)
            if (setting == 4):
                break
    return BattleshipGame(settings)
Configure and create a game.

Creates a game with base settings equivalent to one of the default presets.
Allows user to customize the settings before starting the game.

Parameters
----------
gm : int
    Game type to replicate:
        0: Normal mode.
        1: Advanced mode.

Returns
-------
BattleshipGame
    Game instance with user-chosen settings.
def create_game(gm):
    '\n    Configure and create a game.\n\n    Creates a game with base settings equivalent to one of the default presets.\n    Allows user to customize the settings before starting the game.\n\n    Parameters\n    ----------\n    gm : int\n        Game type to replicate:\n            0: Normal mode.\n            1: Advanced mode.\n\n    Returns\n    -------\n    BattleshipGame\n        Game instance with user-chosen settings.\n    '
    print(('\n' * PAD_AMOUNT))
    if (gm == 0):
        Utils.box_string('Normal Mode', print_string=True)
        settings = normal_mode_preset
    elif (gm == 1):
        Utils.box_string('Advanced Mode', print_string=True)
        settings = advanced_mode_preset
    else:
        Utils.box_string('Testing Mode', print_string=True)
        settings = testing_preset
    Utils.print_settings(settings)
    if (Utils.num_input('Would you like to change the settings?', 'No', 'Yes') == 1):
        while True:
            setting = Utils.num_input('Settings', 'Grid Size', 'Ship Amount', 'Special Abilities', 'Game Type', 'Exit')
            if (setting == 0):
                settings['width'] = int(Utils.string_input('Grid Width (5-26)', condition='^[5-9]$|^1[0-9]$|^2[0-6]$'))
                settings['height'] = int(Utils.string_input('Grid Height (5-26)', condition='^[5-9]$|^1[0-9]$|^2[0-6]$'))
            elif (setting == 1):
                while True:
                    settings['5_ships'] = int(Utils.string_input('5-Long Ships (0-9)', condition='[0-9]'))
                    settings['4_ships'] = int(Utils.string_input('4-Long Ships (0-9)', condition='[0-9]'))
                    settings['3_ships'] = int(Utils.string_input('3-Long Ships (0-9)', condition='[0-9]'))
                    settings['2_ships'] = int(Utils.string_input('2-Long Ships (0-9)', condition='[0-9]'))
                    settings['1_ships'] = int(Utils.string_input('1-Long Ships (0-9)', condition='[0-9]'))
                    count = ((((settings['5_ships'] + settings['4_ships']) + settings['3_ships']) + settings['2_ships']) + settings['1_ships'])
                    if (count == 0):
                        Utils.box_string('You must have at least one ship!', print_string=True)
                    elif (count > 26):
                        Utils.box_string('You have put in too many ships! (max 26)', print_string=True)
                    elif ((((((settings['5_ships'] * 5) + (settings['4_ships'] * 4)) + (settings['3_ships'] * 3)) + (settings['2_ships'] * 2)) + settings['1_ships']) > (settings['width'] * settings['height'])):
                        Utils.box_string('Your ships will not fit inside of the board!', print_string=True)
                    else:
                        break
            elif (setting == 2):
                settings['allow_moves'] = (Utils.num_input('Ship Moving', 'Enable', 'Disable') == 0)
                if settings['allow_moves']:
                    settings['allow_mines'] = (Utils.num_input('Mines', 'Enable', 'Disable') == 0)
                settings['mine_turns'] = (int(Utils.string_input('Turns Between Mines', condition='\\d+')) if settings['allow_mines'] else None)
            elif (setting == 3):
                settings['p_type'] = ['CPU', 'Player'][Utils.num_input('Game Type', 'CPU', 'Player')]
            Utils.print_settings(settings)
            if (setting == 4):
                break
    return BattleshipGame(settings)