Sort a concatenated sequence
JavaScript ES6, 127 135
(a,b)=>eval("for(n=r=[],v=13,o=a+n+b;v--;a=b,b=t)o+=t=b+a;for(d of o+'0'.repeat(99))(n+=d)>+v&&(r.push(v=n),n='');+v?r:[...o]")
Test
F=(a,b)=>eval("for(n=r=[],v=13,o=a+n+b;v--;a=b,b=t)o+=t=b+a;for(d of o+'0'.repeat(99))(n+=d)>+v&&(r.push(v=n),n='');+v?r:[...o]")
// less golfed
U=(a,b)=>{
for(n=r=[], o=a+n+b, v=13; v--; a=b, b=t)
o+= t= b+a;
for(d of o+'0'.repeat(99))
if ((n+=d) > +v)
r.push(v=n), n='';
return +v ? r : [...o]
}
function test(){
var i = I.value.match(/\d+/g)
O.textContent = i.length > 1 ? F(+i[0],+i[1]) : ''
}
test()
A,B : <input id=I value='0 1' oninput='test()'>
<pre id=O></pre>
JavaScript ES6, 187 180 187 184 182 179 175 172 165 160 155 154 bytes
(a,b)=>eval('d=""+a+b;for(i=-12,j=1;++i<99;)i<2?(c=b,d+=b=a+b,a=c,r=a?[d[0]]:"0,".repeat(15)):(f=+d.slice(j,i))>r[r.length-1]?(r.push(f),j=++i-1):d+=0;r')
I get similar results when run it for 1,1
and 3,2
test cases. 0,0
has taken an excess 26 bytes...
De-golf + converted to ES5 + demo:
function s(a, b) {
d = "" + a + b;
for (i = -12, j = 1; ++i < 99;)
i < 2 ?
(c = b, d += b = a + b, a = c, r = a ? [d[0]] : "0,".repeat(15))
: (f = +d.slice(j, i)) > r[r.length - 1] ?
(r.push(f), j = ++i - 1)
: d += 0;
return r
}
document.write(
s(1,1)+"<br>"+
s(3,2)+"<br>"+
s(0,0)
)