Knight Moves

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

Given a square from a1 to h8, print the number of valid knight moves from that square on a standard chessboard.

Options

exec is denied

rejudge feature is enabled

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

Sample input:_

a1
a2
a3
a4
a5
a6
a7
a8
b1
b2
b3
b4
b5
b6
b7
b8
c1
c2
c3
c4
c5
c6
c7
c8
d1
d2
d3
d4
d5
d6
d7
d8
e1
e2
e3
e4
e5
e6
e7
e8
f1
f2
f3
f4
f5
f6
f7
f8
g1
g2
g3
g4
g5
g6
g7
g8
h1
h2
h3
h4
h5
h6
h7
h8

Sample output:

2
3
4
4
4
4
3
2
3
4
6
6
6
6
4
3
4
6
8
8
8
8
6
4
4
6
8
8
8
8
6
4
4
6
8
8
8
8
6
4
4
6
8
8
8
8
6
4
3
4
6
6
6
6
4
3
2
3
4
4
4
4
3
2

Sample input:_

g7
a7
d6
f6
c2
a1
b6
a5
h7
g3
c5
c8
g2
h5
e4
h3
f2
c7
f1
h8
d4
b2
a6
g5
d3
h2
h1
g6
c6
h4
g1
c3
e2
d2
g8
b3
d7
d5
e1
b7
d1
f3
a4
g4
d8
e6
c1
a3
e7
b1
e8
f7
b5
a8
a2
b8
f8
f5
f4
e3
b4
c4
e5
h6

Sample output:

4
3
8
8
6
2
6
4
3
6
8
4
4
4
8
4
6
6
4
2
8
4
4
6
8
3
2
6
8
4
3
8
6
6
3
6
6
8
4
4
4
8
4
6
4
8
4
4
6
3
4
6
6
2
3
3
4
8
8
8
6
8
8
4

Sample input:_

a2
g3
a7
g6
b4
b8
c3
f1
d3
c6
f2
b7
a6
h1
g1
h3
g5
d8
a8
e7
a3
h6
f4
h4
d5
c2
e6
c8
g8
f6
a1
f8
f5
b3
e4
b6
e3
d1
b5
g2
g4
c5
h5
h8
c4
e1
a4
e8
e2
d6
e5
b2
h7
h2
f7
c1
g7
f3
a5
d7
d2
b1
d4
c7

Sample output:

3
6
3
6
6
3
8
4
8
8
6
4
4
2
3
4
6
4
2
6
4
4
8
4
8
6
8
4
3
8
2
4
8
6
8
6
8
4
6
4
6
8
4
2
8
4
4
4
6
8
8
4
3
3
6
4
4
8
4
6
6
3
8
6

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1rotary-o450.05682021/07/11 20:15:515B / 21B / 16B
2teebee450.03682021/07/12 06:51:110B / 26B / 19B
3Histocrat630.05732021/07/10 21:58:230B / 22B / 38B
4Sisyphus (teebee)420.03602021/07/13 15:35:220B / 23B / 18B

Ruby2 _

RankUserSizeTimeDateStatistics
1rotary-o460.27662021/07/11 20:22:000B / 26B / 16B
2teebee480.18602021/07/09 05:28:140B / 29B / 18B

Perl _

RankUserSizeTimeDateStatistics
1tails350.04462021/07/06 21:59:020B / 18B / 15B
2teebee350.04582021/07/07 05:53:390B / 18B / 15B

Python _

RankUserSizeTimeDateStatistics
1Dingledooper610.09582021/07/10 09:04:390B / 38B / 19B
2Erik the Outgolfer640.19442021/07/10 03:21:230B / 47B / 16B

Python3 _

RankUserSizeTimeDateStatistics
1orthoplex650.14602021/07/07 20:03:230B / 35B / 27B

C _

RankUserSizeTimeDateStatistics
1tails710.03202021/07/08 11:08:362B / 33B / 36B

Haskell _

RankUserSizeTimeDateStatistics
1lynn810.05012021/07/10 00:17:530B / 51B / 29B

Java _

RankUserSizeTimeDateStatistics
1rotary-o1300.18512021/07/10 10:46:350B / 76B / 50B

AWK _

RankUserSizeTimeDateStatistics
1Fleur360.04212021/07/09 09:01:420B / ?B / ?B
2teebee360.04222021/07/10 08:40:420B / 12B / 24B
3tails (Fleur,teebee)350.04102021/07/13 15:52:090B / 11B / 24B

sed _

RankUserSizeTimeDateStatistics
1tails530.04422021/07/07 11:44:390B / 19B / 30B
2Fleur700.04252021/07/09 16:36:560B / ?B / ?B
3McBusLuck680.04282021/07/14 02:39:590B / 43B / 20B

Bash _

RankUserSizeTimeDateStatistics
1McBusLuck470.03022021/07/14 02:58:350B / 30B / 12B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails800.22502021/07/08 14:53:360B / 30B / 41B

xgawk _

RankUserSizeTimeDateStatistics
1teebee360.05782021/07/11 06:15:540B / 12B / 24B
2McBusLuck350.05692021/07/15 00:51:160B / 11B / 24B

gs2 _

RankUserSizeTimeDateStatistics
1tails130.26982021/07/07 10:41:346B / 5B / 2B

Lazy-K _

RankUserSizeTimeDateStatistics
1tails5260.05412021/07/07 14:19:150B / 290B / 236B

z80 _

RankUserSizeTimeDateStatistics
1McBusLuck350.18192021/07/15 03:43:0926B / 5B / 4B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o637.34692021/07/10 11:22:270B / 42B / 20B
2rotary-o616.50792021/07/14 00:59:130B / 40B / 20B

Language Ranking_

RankLangUserSizeScore
1gs2tails1310000
2Perltails353714
3AWKtails (Fleur,teebee)353714
4xgawkMcBusLuck353714
5z80McBusLuck353714
6RubySisyphus (teebee)423095
7Ruby2rotary-o462826
8BashMcBusLuck472765
9sedtails532452
10PythonDingledooper612131
11Scalarotary-o612131
12Python3orthoplex652000
13Ctails711830
14Bash (builtins)tails801625
15Haskelllynn811604
16Javarotary-o1301000
17Lazy-Ktails526247

return to the top page