Lines Matching refs:from

77 	var from = move & 0xFF;
83 var pieceType = g_board[from] & 0x7;
93 if (moveFrom != from &&
97 if ((moveFrom & 0xF0) == (from & 0xF0)) {
100 if ((moveFrom & 0x0F) == (from & 0x0F)) {
108 result += FormatSquare(from).charAt(0);
110 result += FormatSquare(from).charAt(1);
112 result += FormatSquare(from);
115 result += FormatSquare(from).charAt(0);
329 var from = g_pieceList[pieceIdx++];
330 while (from != 0) {
331 from = g_pieceList[pieceIdx++];
337 var from, to, mob, pieceIdx;
344 from = g_pieceList[pieceIdx++];
345 while (from != 0) {
346 mob += mobUnit[g_board[from + 31]];
347 mob += mobUnit[g_board[from + 33]];
348 mob += mobUnit[g_board[from + 14]];
349 mob += mobUnit[g_board[from - 14]];
350 mob += mobUnit[g_board[from - 31]];
351 mob += mobUnit[g_board[from - 33]];
352 mob += mobUnit[g_board[from + 18]];
353 mob += mobUnit[g_board[from - 18]];
354 from = g_pieceList[pieceIdx++];
361 from = g_pieceList[pieceIdx++];
362 while (from != 0) {
363 to = from - 15; while (g_board[to] == 0) { to -= 15; mob++; }
372 to = from - 17; while (g_board[to] == 0) { to -= 17; mob++; }
381 to = from + 15; while (g_board[to] == 0) { to += 15; mob++; }
390 to = from + 17; while (g_board[to] == 0) { to += 17; mob++; }
399 from = g_pieceList[pieceIdx++];
406 from = g_pieceList[pieceIdx++];
407 while (from != 0) {
408 to = from - 1; while (g_board[to] == 0) { to--; mob++;} if (g_board[to] & enemy) mob++;
409 to = from + 1; while (g_board[to] == 0) { to++; mob++; } if (g_board[to] & enemy) mob++;
410 … to = from + 16; while (g_board[to] == 0) { to += 16; mob++; } if (g_board[to] & enemy) mob++;
411 … to = from - 16; while (g_board[to] == 0) { to -= 16; mob++; } if (g_board[to] & enemy) mob++;
412 from = g_pieceList[pieceIdx++];
419 from = g_pieceList[pieceIdx++];
420 while (from != 0) {
421 … to = from - 15; while (g_board[to] == 0) { to -= 15; mob++; } if (g_board[to] & enemy) mob++;
422 … to = from - 17; while (g_board[to] == 0) { to -= 17; mob++; } if (g_board[to] & enemy) mob++;
423 … to = from + 15; while (g_board[to] == 0) { to += 15; mob++; } if (g_board[to] & enemy) mob++;
424 … to = from + 17; while (g_board[to] == 0) { to += 17; mob++; } if (g_board[to] & enemy) mob++;
425 to = from - 1; while (g_board[to] == 0) { to--; mob++; } if (g_board[to] & enemy) mob++;
426 to = from + 1; while (g_board[to] == 0) { to++; mob++; } if (g_board[to] & enemy) mob++;
427 … to = from + 16; while (g_board[to] == 0) { to += 16; mob++; } if (g_board[to] & enemy) mob++;
428 … to = from - 16; while (g_board[to] == 0) { to -= 16; mob++; } if (g_board[to] & enemy) mob++;
429 from = g_pieceList[pieceIdx++];
629 var from = hashMove & 0xFF;
631 var ourPiece = g_board[from];
646 var dir = to - from;
669 if (g_board[from - 16] != 0) return false;
674 if (g_board[from + 16] != 0) return false;
683 return IsSquareAttackableFrom(to, from);
1660 var from = move & 0xFF;
1662 var piece = g_board[from];
1678 if (IsSquareAttackable(from + 1, otherColor) ||
1679 IsSquareAttackable(from + 2, otherColor)) {
1701 if (IsSquareAttackable(from - 1, otherColor) ||
1702 IsSquareAttackable(from - 2, otherColor)) {
1742 var diff = to - from;
1750 g_hashKeyLow ^= g_zobristLow[from][piece & 0xF];
1751 g_hashKeyHigh ^= g_zobristHigh[from][piece & 0xF];
1757 g_castleRights &= g_castleRightsMask[from] & g_castleRightsMask[to];
1759 g_baseEval -= pieceSquareAdj[piece & 0x7][me == 0 ? flipTable[from] : from];
1762 g_pieceIndex[to] = g_pieceIndex[from];
1799 g_board[to] = g_board[from];
1803 g_board[from] = pieceEmpty;
1816 if (ExposesCheck(from, kingPos)) {
1839 g_inCheck = ExposesCheck(from, theirKingPos);
1880 var from = move & 0xFF;
1907 g_board[from] = piece;
1909 var pawnType = g_board[from] & 0xF;
1923 g_board[from] = g_board[to];
1938 g_pieceIndex[from] = g_pieceIndex[to];
1939 g_pieceList[((piece & 0xF) << 4) | g_pieceIndex[from]] = from;
1950 function ExposesCheck(from, kingPos){ argument
1951 var index = kingPos - from + 128;
1969 function IsSquareOnPieceLine(target, from) { argument
1970 var index = from - target + 128;
1971 var piece = g_board[from];
1975 function IsSquareAttackableFrom(target, from){ argument
1976 var index = from - target + 128;
1977 var piece = g_board[from];
1982 from += inc;
1983 if (from == target)
1985 } while (g_board[from] == 0);
2013 function GenerateMove(from, to) { argument
2014 return from | (to << 8);
2017 function GenerateMove(from, to, flags){
2018 return from | (to << 8) | flags;
2038 var from, to, piece, pieceIdx;
2042 from = g_pieceList[pieceIdx++];
2043 while (from != 0) {
2044 GeneratePawnMoves(moveStack, from);
2045 from = g_pieceList[pieceIdx++];
2050 from = g_pieceList[pieceIdx++];
2051 while (from != 0) {
2052 to = from + 31; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2053 to = from + 33; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2054 to = from + 14; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2055 to = from - 14; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2056 to = from - 31; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2057 to = from - 33; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2058 to = from + 18; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2059 to = from - 18; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2060 from = g_pieceList[pieceIdx++];
2065 from = g_pieceList[pieceIdx++];
2066 while (from != 0) {
2067 …to = from - 15; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2068 …to = from - 17; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2069 …to = from + 15; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2070 …to = from + 17; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2071 from = g_pieceList[pieceIdx++];
2076 from = g_pieceList[pieceIdx++];
2077 while (from != 0) {
2078 …to = from - 1; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); to…
2079 …to = from + 1; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); to…
2080 …to = from + 16; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2081 …to = from - 16; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2082 from = g_pieceList[pieceIdx++];
2087 from = g_pieceList[pieceIdx++];
2088 while (from != 0) {
2089 …to = from - 15; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2090 …to = from - 17; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2091 …to = from + 15; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2092 …to = from + 17; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2093 …to = from - 1; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); to…
2094 …to = from + 1; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); to…
2095 …to = from + 16; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2096 …to = from - 16; while (g_board[to] == 0) { moveStack[moveStack.length] = GenerateMove(from, to); t…
2097 from = g_pieceList[pieceIdx++];
2103 from = g_pieceList[pieceIdx];
2104 to = from - 15; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2105 to = from - 17; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2106 to = from + 15; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2107 to = from + 17; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2108 to = from - 1; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2109 to = from + 1; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2110 to = from - 16; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2111 to = from + 16; if (g_board[to] == 0) moveStack[moveStack.length] = GenerateMove(from, to);
2119 if (g_board[from + 1] == pieceEmpty && g_board[from + 2] == pieceEmpty) {
2120 … moveStack[moveStack.length] = GenerateMove(from, from + 0x02, moveflagCastleKing);
2125 …if (g_board[from - 1] == pieceEmpty && g_board[from - 2] == pieceEmpty && g_board[from - 3] == pie…
2126 … moveStack[moveStack.length] = GenerateMove(from, from - 0x02, moveflagCastleQueen);
2134 var from, to, piece, pieceIdx;
2140 from = g_pieceList[pieceIdx++];
2141 while (from != 0) {
2142 to = from + inc - 1;
2144 MovePawnTo(moveStack, from, to);
2147 to = from + inc + 1;
2149 MovePawnTo(moveStack, from, to);
2152 from = g_pieceList[pieceIdx++];
2159 var from = g_enPassentSquare - (inc + 1);
2160 if ((g_board[from] & 0xF) == pawn) {
2161 moveStack[moveStack.length] = GenerateMove(from, g_enPassentSquare, moveflagEPC);
2164 from = g_enPassentSquare - (inc - 1);
2165 if ((g_board[from] & 0xF) == pawn) {
2166 moveStack[moveStack.length] = GenerateMove(from, g_enPassentSquare, moveflagEPC);
2172 from = g_pieceList[pieceIdx++];
2173 while (from != 0) {
2174 to = from + 31; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2175 to = from + 33; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2176 to = from + 14; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2177 to = from - 14; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2178 to = from - 31; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2179 to = from - 33; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2180 to = from + 18; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2181 to = from - 18; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2182 from = g_pieceList[pieceIdx++];
2187 from = g_pieceList[pieceIdx++];
2188 while (from != 0) {
2189 …to = from; do { to -= 15; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2190 …to = from; do { to -= 17; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2191 …to = from; do { to += 15; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2192 …to = from; do { to += 17; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2193 from = g_pieceList[pieceIdx++];
2198 from = g_pieceList[pieceIdx++];
2199 while (from != 0) {
2200 …to = from; do { to--; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack.len…
2201 …to = from; do { to++; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack.len…
2202 …to = from; do { to -= 16; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2203 …to = from; do { to += 16; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2204 from = g_pieceList[pieceIdx++];
2209 from = g_pieceList[pieceIdx++];
2210 while (from != 0) {
2211 …to = from; do { to -= 15; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2212 …to = from; do { to -= 17; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2213 …to = from; do { to += 15; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2214 …to = from; do { to += 17; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2215 …to = from; do { to--; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack.len…
2216 …to = from; do { to++; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack.len…
2217 …to = from; do { to -= 16; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2218 …to = from; do { to += 16; } while (g_board[to] == 0); if (g_board[to] & enemy) moveStack[moveStack…
2219 from = g_pieceList[pieceIdx++];
2225 from = g_pieceList[pieceIdx];
2226 to = from - 15; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2227 to = from - 17; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2228 to = from + 15; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2229 to = from + 17; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2230 to = from - 1; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2231 to = from + 1; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2232 to = from - 16; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2233 to = from + 16; if (g_board[to] & enemy) moveStack[moveStack.length] = GenerateMove(from, to);
2250 function GeneratePawnMoves(moveStack, from) { argument
2251 var piece = g_board[from];
2256 var to = from + inc;
2258 MovePawnTo(moveStack, from, to, pieceEmpty);
2261 if ((((from & 0xF0) == 0x30) && color != colorWhite) ||
2262 (((from & 0xF0) == 0x80) && color == colorWhite)) {
2265 moveStack[moveStack.length] = GenerateMove(from, to);
2286 var from = move & 0xFF;
2289 var fromPiece = g_board[from];
2326 g_board[from] = 0;
2330 g_board[from] = fromPiece;
2342 g_board[from] = fromPiece;
2356 g_board[from] = fromPiece;