Tiny Sort

Discussion of challenges you have already solved
Post Reply
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Tiny Sort

Post by tails »

I don't like my 38i code because it's very inaccurate. Its lucky ratio (the ratio of input datasets from which the code produces correct results) is about 1/330, supposing the data are distributing uniformly between 0 and 999999. The lucky ratio of my similar 37i code is about 1/2000, so I won't try with it.

And I don't like one-liners very much because it spoils the taste of SuperHack. But one-liners surely have an advantage in size. It may be interesting if we measure width + height, instead of width * height, to discourage one-liners.
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Re: Tiny Sort

Post by teebee »

tails wrote:I will be waiting at 38, so please feel free go beyond me.
Here I am, thanks for waiting at the top of the hil :-)
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Post by teebee »

I think that the solution of tails is more effective than mine:

Code: Select all

0,p@s!@@@@@@@@@.,x05gx*d0>}x?s$01gPxp$
However, after submitting it again and again (and waiting one hour between two trials) it finally passed the test for the following set of numbers: 303, 6951, 11765, 17905, 22594, 33995, 50026, 56703, 58725, 63605, 65081, 71181, 82437, 91832, 93416, 96196.
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Post by tails »

Hi, teebee! :)
My code is very similar to yours.

Code: Select all

,p0@s!@@@@@@@@@.},x75*x*d0>x?s$00gPp0$
I like how you make the divisor. I tried 84* and 75*, but didn't think of that!
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Post by teebee »

I am sorry, tails, but I could not resist... I solved it with a cron job which submitted this (obvious) 37 instructions code:

Code: Select all

0,p@s!@@@@@@@@.,x67*x*d0>}x?s$01gPxp$
a.goth
Posts: 43
Joined: Sat Sep 14, 2013 10:39 am

Tiny Sort

Post by a.goth »

It was really hard to beat teebee's score, but after almost exactly eleven years, I climbed the hill using the SuperHack program

    ,x@s!@p@@@@@@@@@},x00<d0>x?s$00gPp0$

whose probability of success, determined on the basis of 10,000 test cases, is 1/1000, which is not too bad.

By removing one of the nine consecutive at signs you get an even shorter solution, but the probability of success is only 1/5000. This corresponds to almost seven months and I don't want to let my computer run continuously for that long. What do you think?
Post Reply