from __future__ import print_function

EXTENDED = 'Ext'
TRIGGERS = {
    'P': '"Push"',
    'S': '"Switch"',
    'W': '"WalkOver"',
    'G': '"Gun"',
}

SPEEDS = {
    '----': 0,
    'Slow': 8,
    'Normal': 16,
    'Fast': 32,
    'Turbo': 64,
    'Inst': 16384,
}

LOCKS = {
    'No': None,
    'Blue': 0,
    'Red': 1,
    'Yell': 2,
}


def to_special_type(column):
    return int(column)


def to_extended(column):
    return column == EXTENDED


def to_trigger_and_only_once(column):
    return TRIGGERS[column[0]], column[1] == '1'


def to_wait(column):
    if column == '--':
        return 0.0
    return float(column.rstrip('s'))


def split_chunk(chunk, n_columns):