Knight on the Rim is Grim Introduction
Aron Nimzowitsch was a leading chess master and a influential chess writer.
In his book 'My System', the first chapter deals about the importance of the center and why you should dominate it. The simple reason is that your pieces have more possible direct next moves when being in the center which again gives the player more power.
This gets very clear when looking at different positions of a knight and its potential next moves (shown in pink) on an empty board:

Objective
Evaluate the number of potential direct next moves of a knight on an empty board based on its position.
Input Specs
The position of the knight.
First the x (column) and then the y (row). 0 0 is the left bottom corner.
For simplicity, I changed the labels of a chess board to numbers only. For our examples and test cases we use a 0-based index, you are free to use a 1-based index though.
You can use any type of possible input formats, an array, function arguments, etc.
Output Specs
The number of potential direct next moves for a knight on an empty board.
Test Cases
3 4 =&gt; 8
4 6 =&gt; 6
7 7 =&gt; 2
1 0 =&gt; 3

Test cases are employing a 0-based index. The full grid of values is:
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
Python 2, 35 bytes



lambda x,y:50/(8+x*x/7-x+y*y/7-y)-4


Try it online!



Python 2, 39 bytes



lambda x,y:50/(8-x*(7-x)/5-y*(7-y)/5)-4


Try it online!

Takes inputs 0-indexed.

The expression x*(7-x)/5 takes the coordinate values 0..7 to

[0, 1, 2, 2, 2, 2, 1, 0]


(min(x,7-x,2) does the same, but is longer.) Summing this for x and y gives the right pattern but with the wrong numbers

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


(See Neil's solution for better reasoning as to why this gives about the right pattern.)

Finally, the mapping a -&gt; 50/(8-a)-4 with floor-division gives the right values

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


An alternative equally-long solution with 1-indexed inputs:

lambda x,y:(x*(9-x)/6+y*(9-y)/6)**2/6+2