Skip to content

Commit

Permalink
Revert "rook pins"
Browse files Browse the repository at this point in the history
This reverts commit 1e23086.
  • Loading branch information
glinscott committed Dec 8, 2012
1 parent 1e23086 commit 1180970
Showing 1 changed file with 5 additions and 29 deletions.
34 changes: 5 additions & 29 deletions js/garbochess.js
Expand Up @@ -392,37 +392,13 @@ function Mobility(color) {
pieceIdx = (color | 4) << 4;
from = g_pieceList[pieceIdx++];
while (from != 0) {
to = from - 1; while (g_board[to] == 0) { to--; mob++;}
if ((g_board[to] & enemy) && !(g_board[to] & piecePawn)) {
mob++;
to--; while (g_board[to] == 0) to--;
mob += mobUnit[g_board[to]] << 2;
}

to = from + 1; while (g_board[to] == 0) { to++; mob++; }
if ((g_board[to] & enemy) && !(g_board[to] & piecePawn)) {
mob++;
to++; while (g_board[to] == 0) to++;
mob += mobUnit[g_board[to]] << 2;
}

to = from + 16; while (g_board[to] == 0) { to += 16; mob++; }
if ((g_board[to] & enemy) && !(g_board[to] & piecePawn)) {
mob++;
to += 16; while (g_board[to] == 0) to += 16;
mob += mobUnit[g_board[to]] << 2;
}

to = from - 16; while (g_board[to] == 0) { to -= 16; mob++; }
if ((g_board[to] & enemy) && !(g_board[to] & piecePawn)) {
mob++;
to -= 16; while (g_board[to] == 0) to -= 16;
mob += mobUnit[g_board[to]] << 2;
}

to = from - 1; while (g_board[to] == 0) { to--; mob++;} if (g_board[to] & enemy) mob++;
to = from + 1; while (g_board[to] == 0) { to++; mob++; } if (g_board[to] & enemy) mob++;
to = from + 16; while (g_board[to] == 0) { to += 16; mob++; } if (g_board[to] & enemy) mob++;
to = from - 16; while (g_board[to] == 0) { to -= 16; mob++; } if (g_board[to] & enemy) mob++;
from = g_pieceList[pieceIdx++];
}
result += 20 * mob;
result += 25 * mob;

// Queen mobility
mob = -2;
Expand Down

0 comments on commit 1180970

Please sign in to comment.