Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: XFiles...

Author: Jorge Pichard

Date: 13:41:22 08/25/04

Go up one level in this thread


On August 25, 2004 at 16:21:53, Uri Blass wrote:

>On August 25, 2004 at 15:01:14, Eugenio Castillo wrote:
>
>>Dear all,
>>
>>I return from my vacations past day 23 and I only conect to internet to read my
>>emails. Last 4 days before I do nothing of internet.Yesterday was the first day
>>I conect to this forum (one of my lovest one) and I don’t answer any message
>>before I send a Chinito documentation (evaluate, quiescence, search,
>>movegeneration sources and a small explanation) to Robert Hyatt, and wait a
>>first answer.
>>
>>Paul Hunter has been the first person in internet who has made public a
>>declaration about relations between Crafty and Chinito. Since October 2003 about
>>6 guys do it too in private emails to me, i coment my case too to some other
>>computer chess guys. Paul has shown only a very short/easy amount of his study,
>>I’m sure he has more ready.
>>
>>Chinito 3.25 is not the last one public version I’ve, and it’s not the version
>>who has less Craftys “things” I let it 3.25 there, ... to know somethings…..
>>
>>A bit of Chinito’s code:
>>
>>Excuse but i don't know exactly how to copy paste here making tabulations with
>>an armonic struture. I suposse if you copy it over wordpad and you redefines
>>tabulations it will be better.
>>
>>Capture generation:
>>
>>int* GenerateCaptures(int ply, int wtm, int *move) {
>>  register BITBOARD  promotions;
>>  register int to;
>>  unsigned short peonero,cabeza,fpiez;
>>
>>  if (wtm) {
>>		//eugen ataca
>>		peonero = wpiezas [pawn];
>>
>>		for (fpiez=queen;fpiez>0;fpiez--)
>>		{
>>		if (cabeza = bpiezas [fpiez])
>>		{ /*Identificar a los pollos atacantes y volar*/
>>			unsigned short ella,sq,sella,cambi;
>>
>>			while (cabeza)
>>			{	ella = nextex (cabeza);
>>				sq = posb[ella];
>>        		cambi = CtrlW [sq];
>>
>>				while (cambi)
>>				{ sella = nextex (cambi);
>>				  if (sella & peonero && sq > 55)
>>					{*move++=(posw[sella]+(pawn<<12))|(sq<<6)|((fpiez)<<15)|(queen<<18);
>>					}
>>					else
>>						*move++=(posw[sella]+(tiptrolw[sella]<<12))|(sq<<6)|((fpiez)<<15);
>>
>>					cambi ^= sella;
>>				}
>>				cabeza ^= ella;
>>			}
>>		}
>>		}
>>
>>    promotions=(WhitePawns & rank_mask[RANK7])>>8 & ~Occupied;
>>    while (promotions) {
>>      to=LastOne(promotions);
>>      *move++=(to-8)|(to<<6)|(pawn<<12)|(queen<<18);
>>      Clear(to,promotions);
>>    }
>>
>>		if (EnPassant(ply))
>>			if (cabeza = CtrlW [EnPassant(ply)] & peonero)
>>			{ unsigned short ella,sq;
>>
>>				while (cabeza)
>>				{	ella = nextex(cabeza);
>>					sq = posw [ella];
>>					*move++=(sq)|((EnPassant(ply))<<6)|(pawn<<12)|(pawn<<15);
>>					cabeza ^= ella;
>>				}
>>			}
>>  }
>>  else {
>>
>>		//eugen ataca
>>		peonero = bpiezas [pawn];
>>
>>		for (fpiez=queen;fpiez>0;fpiez--)
>>		{
>>		if (cabeza = wpiezas [fpiez])
>>		{ /*Identificar a los pollos atacantes y volar*/
>>			unsigned short ella,sq,sella,cambi;
>>
>>			while (cabeza)
>>			{	ella = nextex (cabeza);
>>				sq = posw[ella];
>>        		cambi = CtrlB [sq];
>>
>>				while (cambi)
>>				{ sella = nextex (cambi);
>>				  if (sella & peonero && sq < 8)
>>					{*move++=(posb[sella]+(pawn<<12))|(sq<<6)|((fpiez)<<15)|(queen<<18);
>>					}
>>					else
>>						*move++=(posb[sella]+(tiptrolb[sella]<<12))|(sq<<6)|((fpiez)<<15);
>>
>>					cambi ^= sella;
>>				}
>>				cabeza ^= ella;
>>			}
>>		}
>>		}
>>
>>		//end eugen ataca
>>
>>    promotions=(BlackPawns & rank_mask[RANK2])<<8 & ~Occupied;
>>    while (promotions) {
>>      to=FirstOne(promotions);
>>      *move++=(to+8)|(to<<6)|(pawn<<12)|(queen<<18);
>>      Clear(to,promotions);
>>    }
>>
>>		if (EnPassant(ply))
>>			if (cabeza = CtrlB [EnPassant(ply)] & peonero)
>>			{ unsigned short ella,sq;
>>
>>				while (cabeza)
>>				{	ella = nextex(cabeza);
>>					sq = posb [ella];
>>					*move++=(sq)|((EnPassant(ply))<<6)|(pawn<<12)|(pawn<<15);
>>					cabeza ^= ella;
>>				}
>>			}
>>  }
>>  return(move);
>>}
>>
>>You can compare it with Crafty and opinate, FirstOne or LastOne of Chinito
>>returns nearly the same thing like Crafty but writed different (I’m sure Paul
>>Hunter has code and a joke ready for it), i'm sure this will make happy many
>>persons (not all). CtrlB,CtrlW, HcB, HcW are the Eugen's (since year 95) and
>>Chinito's attacktables. This tables are refresh (not reinitialized) in any
>>make/unmakemove.
>>
>>How is my king in Check? in Eugen and Chinito:
>>
>>#define Check(wtm) \
>>  ((wtm)?HcB[WhiteKingSQ]:HcW[BlackKingSQ])
>>
>>My Craftys "PinendOnKing" to make checkevasions moves:
>>
>>int PinnedOnKing(int wtm, int square) {
>>  register int ray;
>>	int sq;
>>
>>	if (wtm) {
>>    ray=directions[square][WhiteKingSQ];
>>    if (!ray) return(0);
>>
>>    switch (abs(ray)) {
>>    case 1:
>>			if (CtrlB[square] & (bpiezas [queen] | bpiezas [rook]))
>>			{ sq = WhiteKingSQ;
>>				if (square > WhiteKingSQ)
>>				{	while (lind [sq])
>>					{ sq++;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == -rook || board (sq) == -queen) && square < sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>				}
>>				else
>>					while (lini [sq])
>>					{ sq--;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == -rook || board (sq) == -queen) && square > sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>			}
>>			return(0);
>>    case 7:
>>			if (CtrlB[square] & (bpiezas [queen] | bpiezas [bishop]))
>>			{ sq = WhiteKingSQ;
>>				if (square > WhiteKingSQ)
>>				{	while (diagonalm7 [sq])
>>					{ sq+=7;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == -bishop || board (sq) == -queen) && square < sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>				}
>>				else
>>					while (diagonaln7 [sq])
>>					{ sq-=7;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == -bishop || board (sq) == -queen) && square > sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>			}
>>			return(0);
>>    case 8:
>>			if (CtrlB[square] & (bpiezas [queen] | bpiezas [rook]))
>>			{ sq = WhiteKingSQ;
>>				if (square > WhiteKingSQ)
>>				{	while (colp [sq])
>>					{ sq+=8;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == -rook || board (sq) == -queen) && square < sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>				}
>>				else
>>					while (coln [sq])
>>					{ sq-=8;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == -rook || board (sq) == -queen) && square > sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>			}
>>			return(0);
>>    case 9:
>>			if (CtrlB[square] & (bpiezas [queen] | bpiezas [bishop]))
>>			{ sq = WhiteKingSQ;
>>				if (square > WhiteKingSQ)
>>				{	while (diagonalm9 [sq])
>>					{ sq+=9;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == -bishop || board (sq) == -queen) && square < sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>				}
>>				else
>>					while (diagonaln9 [sq])
>>					{ sq-=9;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == -bishop || board (sq) == -queen) && square > sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>			}
>>			return(0);
>>    }
>>  }
>>  else {
>>    ray=directions[BlackKingSQ][square];
>>    if (!ray) return(0);
>>    switch (abs(ray)) {
>>		case 1:
>>			if (CtrlW[square] & (wpiezas [queen] | wpiezas [rook]))
>>			{ sq = BlackKingSQ;
>>				if (square > BlackKingSQ)
>>				{	while (lind [sq])
>>					{ sq++;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == rook || board (sq) == queen) && square < sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>				}
>>				else
>>					while (lini [sq])
>>					{ sq--;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == rook || board (sq) == queen) && square > sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>			}
>>			return(0);
>>    case 7:
>>			if (CtrlW[square] & (wpiezas [queen] | wpiezas [bishop]))
>>			{ sq = BlackKingSQ;
>>				if (square > BlackKingSQ)
>>				{	while (diagonalm7 [sq])
>>					{ sq+=7;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == bishop || board (sq) == queen) && square < sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>				}
>>				else
>>					while (diagonaln7 [sq])
>>					{ sq-=7;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == bishop || board (sq) == queen) && square > sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>			}
>>			return(0);
>>    case 8:
>>			if (CtrlW[square] & (wpiezas [queen] | wpiezas [rook]))
>>			{ sq = BlackKingSQ;
>>				if (square > BlackKingSQ)
>>				{	while (colp [sq])
>>					{ sq+=8;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == rook || board (sq) == queen) && square < sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>				}
>>				else
>>					while (coln [sq])
>>					{ sq-=8;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == rook || board (sq) == queen) && square > sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>			}
>>			return(0);
>>    case 9:
>>			if (CtrlW[square] & (wpiezas [queen] | wpiezas [bishop]))
>>			{ sq = BlackKingSQ;
>>				if (square > BlackKingSQ)
>>				{	while (diagonalm9 [sq])
>>					{ sq+=9;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == bishop || board (sq) == queen) && square < sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>				}
>>				else
>>					while (diagonaln9 [sq])
>>					{ sq-=9;
>>						if (sq != square)
>>							if (board(sq))
>>							{ if ((board (sq) == bishop || board (sq) == queen) && square > sq)
>>									return (1);
>>								else
>>									return (0);
>>							}
>>					}
>>			}
>>    }
>>  }
>>  return(0);
>>}
>>
>>bpiezas and wpiezas are my particulary Eugen's piece index (like WhiteBishops,
>>WhiteRooks, and so on) Chinito has both things. About the rotated bitboards
>>i don't know certainly if it's or not in version 3.25, after version 3.3 sure
>>not.
>>
>>My bishop evaluation in evaluation function, with craftys comments:
>>
>>  temp = wpiezas [bishop];
>>  while(temp) {
>>		ella = nextex (temp); square = posw [ella];
>>
>>		if (HcB[square])
>>		{ if (CtrlB [square] & bpbr)
>>				Caw |= ella;
>>			namw++;
>>			if (HcB [square] > 63 || (HcB[square] > HcW[square] && tcom [HcW [square] +
>>HcB [square] * 256] <= 0)) //hung question
>>			{ nhungw++;
>>				hungw |= ella;
>>			}
>>		}
>>
>>    score+=bval_w[square];
>>/*
>> ----------------------------------------------------------
>>|                                                          |
>>|   then fold in the mobility score.                       |
>>|                                                          |
>> ----------------------------------------------------------
>>*/
>>		//nueva evaluacion
>>		if (!raiz.endgame)
>>		{ short cant=0;
>>			unsigned short trol=boardtrol [square];
>>
>>			if (CtrlW [square+7] & trol)
>>			{	if (!(HcB [square+7] & 192)) cant+= Wespacio [square+7];
>>				if (CtrlW [square+14] & trol)
>>				{	if (!(HcB [square+14] & 192)) cant+= Wespacio [square+14];
>>					if (CtrlW [square+21] & trol)
>>					{	if (!(HcB [square+21] & 192)) cant+= Wespacio [square+21];
>>						if (CtrlW [square+28] & trol)
>>						{	if (!(HcB [square+28] & 192)) cant+= Wespacio [square+28];
>>							if (CtrlW [square+35] & trol)
>>							{	if (!(HcB [square+35] & 192)) cant+= Wespacio [square+35];
>>								if (CtrlW [square+42] & trol)
>>								{	if (!(HcB [square+42] & 192)) cant+= Wespacio [square+42];
>>									if (CtrlW [square+49] & trol)
>>										if (!(HcB [square+49] & 192)) cant+= Wespacio [square+49];
>>								}
>>							}
>>						}
>>					}
>>				}
>>			}
>>
>>			if (CtrlW [square-7] & trol)
>>			{	if (!(HcB [square-7] & 192)) cant+= Wespacio [square-7];
>>				if (CtrlW [square-14] & trol)
>>				{	if (!(HcB [square-14] & 192)) cant+= Wespacio [square-14];
>>					if (CtrlW [square-21] & trol)
>>					{	if (!(HcB [square-21] & 192)) cant+= Wespacio [square-21];
>>						if (CtrlW [square-28] & trol)
>>						{	if (!(HcB [square-28] & 192)) cant+= Wespacio [square-28];
>>							if (CtrlW [square-35] & trol)
>>							{	if (!(HcB [square-35] & 192)) cant+= Wespacio [square-35];
>>								if (CtrlW [square-42] & trol)
>>								{	if (!(HcB [square-42] & 192)) cant+= Wespacio [square-42];
>>									if (CtrlW [square-49] & trol)
>>										if (!(HcB [square-49] & 192)) cant+= Wespacio [square-49];
>>								}
>>							}
>>						}
>>					}
>>				}
>>			}
>>
>>			if (CtrlW [square+9] & trol)
>>			{	if (!(HcB [square+9] & 192)) cant+= Wespacio [square+9];
>>				if (CtrlW [square+18] & trol)
>>				{	if (!(HcB [square+18] & 192)) cant+= Wespacio [square+18];
>>					if (CtrlW [square+27] & trol)
>>					{	if (!(HcB [square+27] & 192)) cant+= Wespacio [square+27];
>>						if (CtrlW [square+36] & trol)
>>						{	if (!(HcB [square+36] & 192)) cant+= Wespacio [square+36];
>>							if (CtrlW [square+45] & trol)
>>							{	if (!(HcB [square+45] & 192)) cant+= Wespacio [square+45];
>>								if (CtrlW [square+54] & trol)
>>								{	if (!(HcB [square+54] & 192)) cant+= Wespacio [square+54];
>>									if (CtrlW [square+63] & trol)
>>										if (!(HcB [square+63] & 192)) cant+= Wespacio [square+63];
>>								}
>>							}
>>						}
>>					}
>>				}
>>			}
>>
>>			if (CtrlW [square-9] & trol)
>>			{	if (!(HcB [square-9] & 192)) cant+= Wespacio [square-9];
>>				if (CtrlW [square-18] & trol)
>>				{	if (!(HcB [square-18] & 192)) cant+= Wespacio [square-18];
>>					if (CtrlW [square-27] & trol)
>>					{	if (!(HcB [square-27] & 192)) cant+= Wespacio [square-27];
>>						if (CtrlW [square-36] & trol)
>>						{	if (!(HcB [square-36] & 192)) cant+= Wespacio [square-36];
>>							if (CtrlW [square-45] & trol)
>>							{	if (!(HcB [square-45] & 192)) cant+= Wespacio [square-45];
>>								if (CtrlW [square-54] & trol)
>>								{	if (!(HcB [square-54] & 192)) cant+= Wespacio [square-54];
>>									if (CtrlW [square-63] & trol)
>>										if (!(HcB [square-63] & 192)) cant+= Wespacio [square-63];
>>								}
>>							}
>>						}
>>					}
>>				}
>>			}
>>
>>			if (cant > 35)
>>				score += 35;
>>			else
>>				score+=cant;
>>		}
>>
>>/*
>> ----------------------------------------------------------
>>|                                                          |
>>|   now add in a bonus for a bishop blocking a center pawn |
>>|   at D6/E6 as that is very cramping.                     |
>>|                                                          |
>> ----------------------------------------------------------
>>*/
>>    if (white_outpost[square] &&
>>        !(mask_no_pawn_attacks_b[square]&BlackPawns)) {
>>      if ((square==D6 || square==E6) &&
>>          PieceSq(square+8)==-pawn) score+=BLOCKED_CENTER_PAWN;
>>      if ((square==D3 || square==E3) &&
>>          PieceSq(square-8)==pawn) score-=BLOCKED_CENTER_PAWN;
>>    }
>>/*
>> ----------------------------------------------------------
>>|                                                          |
>>|   adjust the white tropism count for this piece.         |
>>|                                                          |
>> ----------------------------------------------------------
>>*/
>>		ctemp = king_tropism_b[Distance(square,raiz.b_kingsq)];
>>
>>		if (ctemp)
>>			w_tropism+=ctemp;
>>		else
>>		{	if (boardtrol[square] & CtrlWW1)
>>				w_tropism+=2;
>>			else
>>			if (boardtrol[square] & CtrlWW2)
>>				w_tropism+=1;
>>		}
>>
>>		temp ^= ella;
>>  }
>>
>>I've use tropism...
>>
>>Now "something" about weak panws:
>>
>>if (pcabeza = raiz.pawn_score.weaks & WhitePawns)
>>	{ int sq;
>>
>>	  while (pcabeza)
>>		{ /*ella = nexte [cabeza];
>>
>>			sq = posw[ella];*/
>>
>>			sq = FirstOne(pcabeza); ella = boardtrol[sq];
>>
>>			//comprobar que realmente es débil
>>			if (mask_pawn_isolated[sq]&WhitePawns) //no es peón aislado
>>			{ //ver el caso del peón aislado porque está cogido
>>				if (HcW[sq+8] > HcB[sq+8])
>>					goto nblanco;//no evaluarlo
>>				if (sq < 48 && HcW[sq+16] & 192)
>>					if (!(board(sq+8) < 0) && !(HcB[sq+8]&192))
>>						goto nblanco;//no evaluarlo
>>			}
>>
>>			ndebw++;
>>
>>			/*if (board(sq)!=pawn)
>>				ndebw--;*/
>>
>>			if (CtrlB [sq] & bpbr)
>>				Caw |= ella;
>>
>>			if (board(sq+8) < 0 && sq < 56)
>>			{ if (board(sq+8) !=-pawn)
>>					score -=5;
>>
>>				if (board(sq+8) == -rook)
>>				  score -= 10;
>>
>>					switch (sq) {
>>					case 9 : if (board (2) == bishop)
>>										 score -= 20; break;
>>					case 11: if (board (2) == bishop)
>>										 score -= 20; break;
>>					case 12: if (board (5) == bishop)
>>										 score -= 20; break;
>>					case 14: if (board (5) == bishop)
>>										 score -= 20;
>>					}
>>			}
>>			else
>>			if (sq < 15)
>>				switch (sq) {
>>					case 9 : if (board (2) == bishop)
>>										 score -= 10; break;
>>					case 11: if (board (2) == bishop)
>>										 score -= 10; break;
>>					case 12: if (board (5) == bishop)
>>										 score -= 10; break;
>>					case 14: if (board (5) == bishop)
>>										 score -= 10;
>>					}
>>
>>
>>			if (HcB[sq])
>>			{ score -= 10;
>>
>>				if (HcB[sq] > HcW[sq]) //hung question
>>					if (!HcW[sq] || tcom [HcW [sq] + HcB [sq] * 256] <= 0);
>>					{ nhungw++;
>>						hungw |= ella;
>>					}
>>
>>				if (CtrlB[sq] & bpiezas [rook])
>>				{	score -= 10;
>>				}
>>
>>				if (HcB [sq] > HcW [sq])
>>					score -= 10;
>>			}
>>
>>			if (raiz.endgame)
>>			if (!(weaktemp && (CtrlW[sq] & wpiezas[bishop])))
>>			{ short i;
>>
>>				i = -Distance(BlackKingSQ,sq) + Distance(WhiteKingSQ,sq);
>>
>>				if (i>0)
>>				{ score -= i * 4;
>>
>>					/*if (!wpiezas[queen])
>>					{	if (i > 3) score -= 30 + i * 2; else score -= i*10;
>>					}
>>					else
>>						if (i > 4) score -= 20; else score -= i*5;*/
>>				}
>>			}
>>
>>			//cabeza ^= ella;
>>nblanco:;
>>			Clear(sq,pcabeza);
>>		}
>>	}
>>
>>Heavy Crafty;
>>
>>A bit more about rooks, with previous Craftys coment to know about where we are:
>>
>>/*
>> ----------------------------------------------------------
>>|                                                          |
>>|   determine if the rook is on an open file.  if it is,   |
>>|   determine if this rook attacks another friendly rook,  |
>>|   making it difficult to drive the rooks off the file.   |
>>|                                                          |
>> ----------------------------------------------------------
>>*/
>>    trop=7;
>>    if (!(file_mask[file]&raiz.all_pawns)) {
>>			score-=ROOK_OPEN_FILE;
>>      trop=FileDistance(square,raiz.w_kingsq);
>>			if (square > 16 && (HcB[(square&7)+8] & 12))
>>				if (HcW[(square&7)+8]<HcB[(square&7)+8])
>>					tdom7b++;
>>    }
>>    else if (!(file_mask[file]&BlackPawns)) {
>>			score-=ROOK_HALF_OPEN_FILE;
>>      trop=FileDistance(square,raiz.w_kingsq);
>>			if (square > 16 && (HcB[(square&7)+8] & 12))
>>				if (HcW[(square&7)+8]<HcB[(square&7)+8] && !(HcW [(square&7)+16] & 192))
>>					tdom7b++;
>>    }
>>    else if (!(minus8dir[square]&BlackPawns)) {
>>      trop=FileDistance(square,raiz.w_kingsq);
>>    }
>>
>>some thing about trapped rooks "in any position"!!!!
>>
>>//new trapped rook algrtm
>>		if (square < 48)
>>		{ unsigned short trol = boardtrol [square];
>>		  short f;
>>
>>			for (f=1;f<8;f++)
>>				if (CtrlB [square+f]&trol)
>>				{ if ((HcW[square+f] < 16 && board (square+f) >= 0) || board (square+f) > 5)
>>						goto buenatorrb;
>>				}	else break;
>>
>>			for (f=-1;f>-8;f--)
>>				if (CtrlB [square+f]&trol)
>>				{	if ((HcW[square+f] < 16 && board (square+f) >= 0) || board (square+f) > 5)
>>						goto buenatorrb;
>>				} else break;
>>
>>			for (f=8;f<8*7;f+=8)
>>				if (CtrlB [square+f]&trol)
>>				{ if ((HcW[square+f] < 16 && board (square+f) >= 0) || board (square+f) > 5)
>>						goto buenatorrb;
>>				}	else break;
>>
>>			for (f=-8;f>-8*7;f-=8)
>>				if (CtrlB [square+f]&trol)
>>				{	if ((HcW[square+f] < 16 && board (square+f) >= 0) || board (square+f) > 5)
>>						goto buenatorrb;
>>				} else break;
>>
>>		if (raiz.endgame)
>>			score += 100;
>>		else
>>			score += 30;
>>
>>		goto yavb;
>>
>>buenatorrb:;
>>
>>now something more pure crafty:
>>
>>/*
>> ----------------------------------------------------------
>>|                                                          |
>>|   see if the rook is behind a passed pawn.  if it is,    |
>>|   it is given a bonus.                                   |
>>|                                                          |
>> ----------------------------------------------------------
>>*/
>>    if ((128>>file)&raiz.pawn_score.passed_b) {
>>      register const int pawnsq=FirstOne(BlackPawns&file_mask[file]);
>>      if (pawnsq < square) {
>>				register const int rbp=(CtrlB[pawnsq]&ella) != 0;
>>        if (rbp && !(WhitePieces&SetMask(pawnsq-8)))
>>          score-=ROOK_BEHIND_PASSED_PAWN;
>>      }
>>    }
>>    if ((128>>file)&raiz.pawn_score.passed_w) {
>>      register const int pawnsq=LastOne(WhitePawns&file_mask[file]);
>>      if (pawnsq > square) {
>>				register const int rbp=(CtrlB[pawnsq]&ella) != 0;
>>        if (rbp) score-=ROOK_BEHIND_PASSED_PAWN;
>>      }
>>    }
>>
>>this next is with the famous call to passedpawnraces:
>>
>>if (raiz.pawn_score.passed_b || raiz.pawn_score.passed_w) {
>>    int pscore=EvaluatePassedPawns();
>>    if (raiz.pawn_score.outside&8)
>>      pscore+=2*outside_passed[(int) TotalBlackPieces];
>>    else if (raiz.pawn_score.outside&4)
>>      pscore+=outside_passed[(int) TotalBlackPieces];
>>    if (raiz.pawn_score.outside&128)
>>      pscore-=2*outside_passed[(int) TotalWhitePieces];
>>    else if (raiz.pawn_score.outside&64)
>>      pscore-=outside_passed[(int) TotalWhitePieces];
>>    if ((TotalWhitePieces==0 && raiz.pawn_score.passed_b) ||
>>        (TotalBlackPieces==0 && raiz.pawn_score.passed_w))
>>		{ char vfinal=0;
>>			int mscore = EvaluatePassedPawnRaces(wtm,&vfinal);
>>
>>			if (vfinal)
>>				return (0);
>>
>>			if (abs(mscore) > 4 && abs (mscore) > abs (score))
>>				score -= score >> 1;
>>
>>			pscore += mscore;
>>		}
>>    score+=pscore*passed_scale/100;
>>
>>		if (raiz.pawn_score.passed_w && !raiz.pawn_score.passed_b && wpiezas [queen])
>>			score += PASSPCONDAMA;
>>		else
>>		if (raiz.pawn_score.passed_b && !raiz.pawn_score.passed_w && bpiezas [queen])
>>			score -= PASSPCONDAMA;
>>  }
>>
>>Here it's not exactly like Crafty, it looks i've used the same namevariables
>>with diferent meanings, or i've made a copy paste a bit drunken?
>>PassepawnsRaces with one stack parameter more to make more difficult the Crafty
>>clone hunters job.
>>Could be it's for identificate drawing endgames? Sacrilege.
>>
>>It's time to see something about passed pawns:
>>
>>if (raiz.pawn_score.passed_w) {
>>		short totalw,totalb,numopac;
>>
>>    white_king_sq=WhiteKingSQ;
>>    pawns=raiz.pawn_score.passed_w;
>>    while (pawns) {
>>			numopac=0;totalw=0;totalb=0;
>>
>>      file=first_ones_8bit[pawns];
>>      pawns&=~(128>>file);
>>      square=LastOne(WhitePawns&file_mask[file]);
>>      if (FileDistance(square,white_king_sq)==1 &&
>>          Rank(white_king_sq)>=Rank(square))
>>        score+=supported_passer[Rank(square)];
>>
>>			if ((HcW [square] & 192) || (HcW [square+8] & 192))
>>				score+=blockading_passed_pawn_value[Rank(square)]>>2;
>>			else
>>      if (SetMask(square+8)&Occupied) {
>>        score-=blockading_passed_pawn_value[Rank(square)]>>1;
>>      }
>>
>>			atb = 0; atw = 0;
>>
>>			for (f=square+8;f<=H8;f+=8)
>>			{ atb |= CtrlB [f]; atw |= CtrlW [f];
>>
>>				if (board(f) < 0)
>>				{ if (board (f) == -king && TotalWhitePieces == rook_v && TotalBlackPieces
>>== rook_v)
>>					{ score -= passed_pawn_value [Rank(square)]>>1;
>>						goto nowpp;
>>					}
>>
>>					if (HcB[f] >= HcW[f])
>>						numopac++;
>>				}
>>			}
>>
>>			atw |= CtrlW[square]&(1|wpiezas[bishop]); //own king action
>>
>>			for (f=square-8;f>=A1;f-=8)
>>			{ atb |= CtrlB[f] & (bpiezas [queen] | bpiezas[rook]);
>>				atw |= CtrlW[f] & (wpiezas [queen] | wpiezas[rook]);
>>				if (board(f) && board(f) != rook)
>>					break;
>>			}
>>
>>			if (atw)
>>			{ unsigned short ella;
>>
>>				if (ella = atw & wpiezas [bishop])
>>				{	totalw += 3;
>>					if (ella & (ella-1))
>>						totalw += 5;
>>				}
>>
>>				if (ella = atw & wpiezas [knight])
>>				{	totalw += 3;
>>					if (ella & (ella-1))
>>						totalw += 3;
>>				}
>>
>>				if (ella = atw & wpiezas [rook])
>>				{	totalw += 4;
>>					if (ella & (ella-1))
>>						totalw += 4;
>>				}
>>
>>				if (atw & wpiezas [queen])
>>					totalw += 8;
>>
>>				if (atw & 1)
>>					totalw += 5;
>>			}
>>
>>			pasados_conecA[square]=totalw;
>>
>>6 lines clearly copypasted.
>>
>>But where is swap? this is very important:
>>
>>				if (HcB[sq])
>>						{ melon = tcom [HcW [sq] - Hcg[Piece(*movep)] + HcB [sq] * 256] -
>>p_values[Piece(*movep)+7];
>>
>>						  if (melon < 0)
>>						    temp=p_values[Captured(*movep)+7]+VVc[Piece(*movep)]+melon;
>>							else
>>								temp=p_values[Captured(*movep)+7]+VVc[Piece(*movep)];
>>						}
>>						else
>>						{ temp=p_values[Captured(*movep)+7]+VVc[Piece(*movep)];
>>						}
>>
>>tcom is an array with possible attacks combinations HcB and HcW includes xrays
>>values. The way this tables work, is described in spanish computer programing
>>magazine named Solo Programadores (my article), because it could be a bit
>>difficult to get in a image about the concept i put a nice diagram about it,
>>unfortunately the diagram was just put accidentally in the next article about
>>celular supervivence simulation.
>>
>>The original crafty swap algorithm exist in some Chinitos versions used ONLY
>>after Checkevasionmove phase generation, and it was there because i forget to
>>delete it.
>>
>>For GNU lovers (my first C experience), here is a bit in my makemove routine
>>from old arrays nextdir and nextpos:
>>
>>else
>>  { if (pieza == pawn)
>>	    pdir = nextdir [blackpawn][sq];
>>	  else
>>			pdir = nextdir [pieza][sq];
>>
>>	  u = pdir[sq];
>>
>>	  do
>>		{ HcB [u] += hc; CtrlB [u] |= trol;
>>		  u = pdir[u];
>>		} while (u != sq);
>>  }
>>
>>my dear sq and u variables.
>>
>>this is used each time a pawn is moved. Try to delete files npos, and ndir and
>>tell me what happens to Chinito. This lines are obsolete but with a great
>>romantic value.
>>
>>There is much more to coment in search, quiescence, and makemove, Bob has now
>>"mostly" of the code "i" consider significant.
>>
>>Why was put Chinito for free in internet?
>>
>>French Dragon programmer talk me to get an Chinito to play with it, he "present"
>>me to Frank who want one to test too.
>>
>>A missunderstanding with Frank Q. (the words “in a future” is not like “now”,
>>and i'm not angry for this with him): put a serious bugged&compromissed version
>>of Chinito in Arena.
>>
>>I'm sure in good relations with Frank Q. because we don't have make still any
>>business :)
>>
>>Still to know what about Pascal Tang and something named XieXie.
>>
>>I don't have time for more until tomorrow....
>>
>>Eugenio.
>
>It seems to me that you started from Crafty and modified it(otherwise you will
>not have problems of forgetting to delete parts of Crafty)
>
>It is not illegal to modify Crafty but if you release a version that is a
>modified Crafty then you need to make your source public.
>
>I think that the best thing that you can do now is simply to release the source
>of Elchinito and change it's name to CraftyElchinitoor Craftinito if you want to
>make it shorter.
>
>Uri


In this world you can take any original design of anything and modify it, just
like the Korean did with the Japanese Honda Civic they took it, modified it and
called it Hyundai. Therefore, Craftchino would be an appropiated name :-)

Jorge



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.