From: Alex LeDonne Date: 2008-07-12T04:25:47+09:00 Subject: Re: [QUIZ] Symbolify (#169) On Fri, Jul 11, 2008 at 2:02 PM, Alex LeDonne wrote: > On Fri, Jul 11, 2008 at 1:19 PM, James Gray wrote: >> On Jul 11, 2008, at 12:16 PM, ara.t.howard wrote: >> >>> >>> On Jul 11, 2008, at 11:07 AM, Dana Merrick wrote: >>> >>>> Haha, I just did it and my solution just happened to be 42 characters. >>> >>> >>> damn - i've usurped! >> >> Mine was 28 characters, with normal whitespace usage. >> >> James Edward Gray II >> > > I managed to golf one char out of my first solution; it's 28 with > "normal whitespace usage", 24 without. The output is ugly and long, > though. > > > I also have a longer solution that produces relatively compact > representations relatively quickly such that > > symbolify(999).length == 145 > symbolify(9999).length == 145 > symbolify(999999).length == 389 > symbolify(12345678901234567890).length == 1290 > symbolify(("9"*2100).to_i).length == 402035 > After clearing a "duh" moment, I've improved these encoded lengths... symbolify(999).length == 127 symbolify(9999).length == 127 symbolify(999999).length == 337 symbolify(12345678901234567890).length == 1112 symbolify(("9"*2100).to_i).length == 350265 -A