Move To Front Encode

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Implement the Move To Front algorithm for numbers 0-9.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

0125348573444285733312432326838202048509871239875663295738035820236457902367590763295067329756903275940738290576493026579403244478479749295979292999273402555525525252556552652625256555555555555555550962734950634729507432056576965493865748987643927567376596327598350865726058674028456026486622002043845730666572347572649375270815646287523930

Sample output:

0125458384400555550065632118731381153839399785557905664546824364147967877775666345656656666365366666576468765768858675776767730058226122417141311100126574600011011111108102222212112100000000000000003734777577755677774566457162713737855664613546585762512352455557538373673545358565366552452030401147526745700447563414548656627895991757538919

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid430.01782013/01/31 07:43:410B / 24B / 17B
2clock430.02622013/02/01 03:17:580B / 24B / 17B
3primo430.03312013/02/08 19:07:550B / 24B / 17B
4jpl530.01472013/02/08 18:12:410B / ?B / ?B
5jbb590.01322013/02/11 03:24:180B / 29B / 30B
6Histocrat730.01232013/01/31 05:53:341B / ?B / ?B

Perl _

RankUserSizeTimeDateStatistics
1teebee380.01352013/02/04 02:31:450B / 16B / 22B
2tails430.03452013/02/04 23:53:520B / 18B / 25B
3brx440.01692013/02/03 22:50:220B / 19B / 24B
4jbb450.01662013/02/11 03:04:100B / 13B / 32B
5ninjalj550.01372013/02/03 11:38:270B / 20B / 35B

Python _

RankUserSizeTimeDateStatistics
1clock820.02502013/02/09 17:15:520B / 48B / 28B
2leonid820.02232013/02/12 02:52:540B / 51B / 25B
3hallvabo850.02962013/01/31 07:16:240B / 48B / 30B
4rolf850.02322013/02/01 07:08:380B / 48B / 31B

Io _

RankUserSizeTimeDateStatistics
1pooq1020.10182013/02/08 07:55:040B / 70B / 28B

JavaScript _

RankUserSizeTimeDateStatistics
1clock790.02262013/02/09 17:45:320B / 55B / 21B
2teebee790.02072013/02/09 21:29:210B / 55B / 21B
3teebee780.02462013/12/08 23:29:540B / 54B / 21B

Lua _

RankUserSizeTimeDateStatistics
1clock770.01512013/02/10 12:45:210B / 51B / 25B
2pooq920.01202013/02/10 12:30:580B / 52B / 39B

SNOBOL _

RankUserSizeTimeDateStatistics
1clock950.01642013/02/09 18:00:150B / 50B / 14B
2ninjalj980.01282013/02/05 23:59:520B / 50B / 19B
3ninjalj (clock)1010.03112013/02/14 17:55:276B / 50B / 14B

Icon _

RankUserSizeTimeDateStatistics
1clock900.00812013/02/13 22:12:200B / 55B / 30B

BASIC _

RankUserSizeTimeDateStatistics
1clock930.00872013/02/10 19:16:460B / 52B / 41B
2pooq950.03092013/02/10 02:10:440B / 50B / 40B
3clock900.01002013/02/14 01:11:370B / 49B / 41B

J _

RankUserSizeTimeDateStatistics
1pooq490.03092013/02/08 20:10:020B / 23B / 24B
2I., S.(pooq)420.02702013/06/02 00:24:260B / 17B / 23B
3I., S.470.02772013/06/01 23:25:420B / 15B / 31B

C _

RankUserSizeTimeDateStatistics
1nu870.01962013/02/14 00:21:370B / 43B / 44B
2orisano980.01072013/02/06 00:01:460B / ?B / ?B
3ush1050.01132013/02/01 17:22:340B / 61B / 43B
4orisano960.01072013/03/16 22:03:560B / 49B / 47B

Haskell _

RankUserSizeTimeDateStatistics
1henkma820.02592013/01/31 21:13:550B / 53B / 27B

Maxima _

RankUserSizeTimeDateStatistics
1pooq990.30242013/02/08 23:53:080B / 67B / 29B

AWK _

RankUserSizeTimeDateStatistics
1teebee680.01392013/02/10 00:54:110B / 36B / 29B
2ninjalj760.01382013/01/31 20:14:100B / 42B / 32B

sed _

RankUserSizeTimeDateStatistics
1tails950.03232013/02/09 15:18:540B / 36B / 51B

xgawk _

RankUserSizeTimeDateStatistics
1teebee680.04582013/02/10 20:03:260B / 36B / 29B
2ninjalj760.01672013/01/31 20:14:240B / 42B / 32B

GolfScript _

RankUserSizeTimeDateStatistics
1tails170.05062013/02/09 14:01:540B / 3B / 14B
2nooodl320.07662013/01/31 03:44:550B / ?B / ?B

Vim _

RankUserSizeTimeDateStatistics
1clock530.19992013/02/05 03:32:244B / 31B / 14B

Groovy _

RankUserSizeTimeDateStatistics
1teebee591.17532013/02/09 20:01:100B / 37B / 21B
2clock591.02582013/02/09 20:46:460B / 37B / 21B

Logo _

RankUserSizeTimeDateStatistics
1teebee750.07742013/02/09 20:20:010B / 45B / 19B
2clock(teebee)740.15302013/02/14 01:24:070B / 46B / 15B

Language Ranking_

RankLangUserSizeScore
1GolfScripttails1710000
2Perlteebee384473
3JI., S.(pooq)424047
4Rubyleonid433953
5Vimclock533207
6Groovyteebee592881
7AWKteebee682500
8xgawkteebee682500
9Logoclock(teebee)742297
10Luaclock772207
11JavaScriptteebee782179
12Haskellhenkma822073
13Pythonclock822073
14Cnu871954
15Iconclock901888
16BASICclock901888
17sedtails951789
18SNOBOLclock951789
19Maximapooq991717
20Iopooq1021666

return top