def build_gameboard(term):
    """Build the gameboard layout."""
    column, row = 0, 0
    board = dict()
    spacing = 2
    for keycode in sorted(term._keycodes.values()):
        if (keycode.startswith('KEY_F')
                and keycode[-1].isdigit()
                and int(keycode[len('KEY_F'):]) > 24):
            continue
        if column + len(keycode) + (spacing * 2) >= term.width:
            column = 0
            row += 1
        board[keycode] = {'column': column,
                          'row': row,
                          'hit': 0,
                          }
        column += len(keycode) + (spacing * 2)
    return board