Thankyou.
The poor knights are jealous now
Code: Select all
int white_knight_mobility(int squaren)
{
int n;
int g = 0;
for (n = 0; n < 8; n++)
if (board[squaren + n_ofs[n]] == npiece)
g++;
if (board[squaren + n_ofs[n]] == bbishop)
g++;
if (board[squaren + n_ofs[n]] == bqueen)
g++;
if (board[squaren + n_ofs[n]] == brook)
g++;
if (board[squaren + n_ofs[n]] == bpawn)
g++;
if (board[squaren + n_ofs[n]] == bking)
g++;
return g;
}