shell game EASY

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

You have four shells. And they have four ascending positions.
Under shell 1 there is a small ball or stone.

1 2 3 4
_ _ _ _
|A| |B| |C| |D|
^

Now that you can't see the thing under the shell, the shells are swapped around. If it begins with 12, shell A and B are swapped. If then comes 23, the shell at the second position (now A) is swapped with C. Now it is not ABCD but BCAD. At the end you will be asked, under which shell the thing is. Now that would be the 3rd shell.

It is a very comprehensive challenge of an addictive game, which is really easy to solve. Even my non-golfed source has only 8 lines.

Remember that in this case it begins every time at position 1!

And to make it harder to cheat I want the position not only at the end but also at every swap, so just make working code!!! (or you would be disqualified in my mind)

Options

exec is denied

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

Sample input:_

12
23
43
34
34
23
12
21
32
43
23
41
24
41
14

Sample output:

2
3
4
3
4
4
4
4
4
3
2
2
4
1
4

Sample input:_

12
12
41
24
12
41
24
44
13
33
21
33
11
34
21
42
34
43
21
42
13
34
14
23
13
21
14
42
43
13

Sample output:

2
1
4
2
1
4
2
2
2
2
1
1
1
1
2
4
3
4
4
2
2
2
2
3
1
2
2
4
3
1

Sample input:_

22
31
22
34
43
41
12
14
14
32
13
14
11
42
44
11
41
14
32
41
42
44
11
14
24
14
34
21
24
12
24
31
12
44
43
32
42
44
32
21
23
43
22
11
42
32
13
31
32
23
43
44
31
13
23
22
23
11
22
13

Sample output:

1
3
3
4
3
3
3
3
3
2
2
2
2
4
4
4
1
4
4
1
1
1
1
4
2
2
2
1
1
2
4
4
4
4
3
2
4
4
4
4
4
3
3
3
3
2
2
2
3
2
2
2
2
2
3
3
2
2
2
2

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid370.06252011/02/20 09:07:380B / 16B / 17B
2ksk380.00942011/03/19 17:38:510B / 15B / 21B
3yvl400.05522011/02/19 21:02:410B / 13B / 26B
4eban420.00652011/03/08 11:19:520B / 21B / 17B
5tsurumau430.01262011/03/02 15:35:060B / ?B / ?B
6aglias490.05172011/02/20 01:17:240B / 22B / 22B

Perl _

RankUserSizeTimeDateStatistics
1tybalt89330.00552011/02/20 02:17:280B / ?B / ?B
2teebee330.00852011/02/20 03:13:100B / 10B / 21B
3tails330.00422011/03/05 05:10:550B / 10B / 23B
4tsurumau360.00512011/02/21 11:34:190B / ?B / ?B
5ninjalj360.01462011/02/21 21:27:100B / 15B / 21B

Python _

RankUserSizeTimeDateStatistics
1recursive510.07142011/03/10 05:06:490B / 29B / 19B
2leonid520.09352011/02/20 11:36:340B / 32B / 16B
3xulapp520.09242011/02/20 12:16:290B / 30B / 19B
4hallvabo540.09882011/02/19 21:27:560B / 34B / 16B
5croyal1080.07142011/03/19 00:43:070B / ?B / ?B

PHP _

RankUserSizeTimeDateStatistics
1tsurumau640.09892011/03/05 03:16:160B / ?B / ?B
2xulapp670.12072011/02/19 19:56:382B / 32B / 33B
3Endres840.10742011/02/19 18:58:355B / ?B / ?B

Scheme _

RankUserSizeTimeDateStatistics
1kaki890.11012011/03/17 22:55:360B / 46B / 35B
2murky-satyr890.10992011/03/18 00:11:300B / 46B / 37B
3youz890.07032011/03/18 16:53:560B / 48B / 34B
4dico_leque900.07522011/03/18 06:04:210B / 36B / 47B
5cddddr990.07652011/03/19 09:16:430B / 57B / 33B
6murky-satyr830.24432011/03/20 17:22:240B / 40B / 38B
7dico_leque860.07562011/03/19 18:45:500B / 44B / 36B

Common LISP _

RankUserSizeTimeDateStatistics
1youz890.20002011/03/03 22:18:170B / 53B / 26B

Arc _

RankUserSizeTimeDateStatistics
1youz626.00942011/03/18 10:09:420B / 27B / 29B
2murky-satyr635.95462011/03/18 01:49:040B / 29B / 27B
3murky-satyr576.56322011/03/20 16:12:560B / 21B / 31B

Clojure _

RankUserSizeTimeDateStatistics
1youz885.37792011/03/18 16:55:250B / 47B / 35B
2murky-satyr795.38482011/03/20 16:29:580B / 44B / 32B

Io _

RankUserSizeTimeDateStatistics
1pooq1120.60002011/03/17 23:59:540B / 75B / 29B

JavaScript _

RankUserSizeTimeDateStatistics
1xulapp480.00552011/02/19 18:58:480B / 28B / 20B
2nn480.00542011/02/19 20:20:070B / 28B / 20B

BASIC _

RankUserSizeTimeDateStatistics
1*yuko*610.00362011/03/14 01:12:080B / 35B / 23B
2pooq850.00872011/02/19 21:22:200B / 48B / 23B

J _

RankUserSizeTimeDateStatistics
1I., S.440.09512011/03/08 22:09:110B / 16B / 27B
2pooq470.10022011/03/07 16:52:550B / 20B / 23B

C _

RankUserSizeTimeDateStatistics
1nn600.00182011/02/21 08:49:180B / 33B / 26B
2not610.00172011/02/20 02:46:050B / 34B / 26B
3inaniwa610.00182011/02/20 09:55:360B / 34B / 26B
4tinyan610.00162011/02/20 18:03:030B / 34B / 26B
5koi640.02002011/02/20 15:08:220B / ?B / ?B
6torikara640.01822011/02/25 00:35:100B / ?B / ?B
7aglias680.00172011/02/20 02:07:380B / 37B / 31B
8tsurumau720.00182011/02/24 20:17:230B / ?B / ?B
9syobon730.00242011/03/19 12:06:060B / ?B / ?B

C++ _

RankUserSizeTimeDateStatistics
1nn730.00192011/02/21 18:32:420B / 42B / 29B
2tinyan1440.00192011/02/21 18:30:048B / 75B / 45B

OCaml _

RankUserSizeTimeDateStatistics
1m.ukai950.13032011/02/23 17:39:250B / 54B / 35B
2ksk950.14612011/03/19 17:29:430B / 54B / 32B

Haskell _

RankUserSizeTimeDateStatistics
1rst76760.00212011/03/01 05:54:100B / 43B / 28B
2notogawa760.00312011/03/02 18:58:540B / 43B / 28B
3Lost_dog760.00282011/03/12 06:34:520B / 46B / 29B

Java _

RankUserSizeTimeDateStatistics
1teebee1400.38022011/03/01 06:48:280B / 82B / 54B

Pascal _

RankUserSizeTimeDateStatistics
1*yuko*990.00212011/02/20 02:58:160B / 63B / 32B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*760.00232011/03/14 01:01:250B / 44B / 31B
2sha800.00242011/03/13 22:37:300B / ?B / ?B
3*yuko*740.03972011/11/27 16:28:290B / 42B / 31B

Maxima _

RankUserSizeTimeDateStatistics
1pooq900.54062011/03/11 00:49:090B / 48B / 41B

Asymptote _

RankUserSizeTimeDateStatistics
1xulapp732.77052011/02/19 20:55:580B / 39B / 33B

AWK _

RankUserSizeTimeDateStatistics
1eban270.00212011/03/08 10:56:120B / 11B / 16B
2tsurumau330.00222011/03/08 02:15:400B / ?B / ?B

sed _

RankUserSizeTimeDateStatistics
1clock620.04252011/12/22 00:37:480B / 13B / 44B

Bash _

RankUserSizeTimeDateStatistics
1ninjalj500.04532011/02/21 22:12:300B / 20B / 28B
2eban561.10132011/02/21 18:11:100B / 24B / 21B

Zsh _

RankUserSizeTimeDateStatistics
1ninjalj500.22502011/02/21 22:12:400B / 20B / 28B

Fish _

RankUserSizeTimeDateStatistics
1ninjalj500.27312011/02/21 22:12:480B / 20B / 28B

Befunge _

RankUserSizeTimeDateStatistics
1kaki440.00302011/03/10 09:21:360B / 14B / 24B

GolfScript _

RankUserSizeTimeDateStatistics
1irori180.15072011/03/04 18:47:090B / 5B / 13B

FlogScript _

RankUserSizeTimeDateStatistics
1zzo38220.25092011/02/22 13:46:180B / 3B / 19B

Lazy-K _

RankUserSizeTimeDateStatistics
1irori5370.02552011/03/05 22:11:050B / 275B / 262B

Grass _

RankUserSizeTimeDateStatistics
1irori2350.05932011/03/06 00:07:350B / 235B / 0B

Universal Lambda _

RankUserSizeTimeDateStatistics
1irori420.01392011/03/05 22:18:0527B / 11B / 3B

z80 _

RankUserSizeTimeDateStatistics
1*yuko*260.25902011/03/03 20:44:1714B / 5B / 6B

goruby _

RankUserSizeTimeDateStatistics
1leonid280.14642011/03/04 04:39:200B / 14B / 12B
2murky-satyr290.17022011/02/19 23:03:330B / 9B / 19B

Groovy _

RankUserSizeTimeDateStatistics
1murky-satyr446.22082011/02/19 22:03:340B / 32B / 10B
2hoozie446.21622011/02/25 19:13:300B / 32B / 11B
3nn466.22612011/02/19 22:29:250B / 33B / 11B

Scala _

RankUserSizeTimeDateStatistics
1murky-satyr7110.61462011/02/20 05:06:160B / 45B / 23B
2pooq8010.87602011/02/28 17:18:100B / 53B / 25B
3Lost_dog8110.08002011/03/12 17:47:490B / 53B / 25B
4dico_leque8211.22172011/03/17 17:10:170B / 51B / 29B

Language Ranking_

RankLangUserSizeScore
1GolfScriptirori1810000
2FlogScriptzzo38228181
3z80*yuko*266923
4AWKeban276666
5gorubyleonid286428
6Perltybalt89335454
7Rubyleonid374864
8Universal Lambdairori424285
9Groovymurky-satyr444090
10JI., S.444090
11Befungekaki444090
12JavaScriptxulapp483750
13Bashninjalj503600
14Zshninjalj503600
15Fishninjalj503600
16Pythonrecursive513529
17Arcmurky-satyr573157
18Cnn603000
19BASIC*yuko*612950
20sedclock622903
21PHPtsurumau642812
22Scalamurky-satyr712535
23Asymptotexulapp732465
24C++nn732465
25Fortran*yuko*742432
26Haskellrst76762368
27Clojuremurky-satyr792278
28Schememurky-satyr832168
29Common LISPyouz892022
30Maximapooq902000
31OCamlm.ukai951894
32Pascal*yuko*991818
33Iopooq1121607
34Javateebee1401285
35Grassirori235765
36Lazy-Kirori537335

return top