Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Is IsiChess a Crafty clone ?

Author: Uri Blass

Date: 06:18:41 08/24/04

Go up one level in this thread


On August 24, 2004 at 09:10:03, Uri Blass wrote:

>On August 24, 2004 at 02:57:41, Uri Blass wrote:
>
>>On August 23, 2004 at 23:45:00, Robert Hyatt wrote:
>>
>>>On August 23, 2004 at 20:29:15, Gerd Isenberg wrote:
>>>
>>>>On August 23, 2004 at 17:41:38, Matthias Gemuh wrote:
>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>Such "standard" code like NextMove is IMHO not sufficent to proof El Chinito as
>>>>>>Crafty clone. Did i missed something?
>>>>>>
>>>>>>BTW. Is it legal to disassembly others executables?
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>Hi Gerd,
>>>>>Is "such standard code like NextMove" also implemented the same way in your
>>>>>engine, IsiChess ? Are the Crafty evaluation functions in ElChinito also
>>>>>standard and in IsiChess ? Are the reported Crafty bugs in ElChinito also
>>>>>standard and present in IsiChess ?
>>>>
>>>>That IsiChess has a complete other movegen does not proof, that El Chinitos
>>>>getMove is a copy of Crafty, even if it is likely, due to the other point with
>>>>eval and the 99999 compare.
>>>>
>>>>I admit that i copied some source code here from CCC via clipboard into my
>>>>program, for instance kogge-stone algorithms. The same might be true for others,
>>>>and the intention i and others post source-code here is to share it and to get a
>>>>feedback, improvements and other ideas.
>>>>
>>>>Is Crafty's getMove-code really so unique and some code snippets got never
>>>>posted here? If i implement some quicksort from some published pseudo code, it
>>>>is not unlikely that i get the same assembly, despite other identifiers.
>>>
>>>That's a poor argument, often tried on me by students.  It doesn't fly.  A
>>>bubblesort or quicksort or heapsort written by two different people might look
>>>the same for bubblesort (10 lines of code) but _definitely_ not for quick/heap
>>>sort.  NextMove() is over 250 lines of code.  The chances of two people writing
>>>two programs independently, and having them produce the _same_ assembly, is so
>>>close to zero that IEEE FP would store it as zero.
>>
>>I agree that having the same NextMove() is wrong but I think that you do not
>>expect people never to read the source of Crafty and learn from it so even if
>>people do not copy Crafty they cannot claim that they wrote their programs
>>independently.
>>
>>I guess that there are also small functions that a lot of people copy like
>>function to count the number of 1 in bitboard or to find the first 1.
>>
>>Uri
>
>I can add that I hesitate what exactly I am allowed to do.
>I plan to have function that is equivalent o r almost equivalent to Crafty
>function InputMove(I plan to return 1 and make the move and print the move in
>notation like g1f3 to some text file in case that the move is legal and to
>return 0 in case that the move is illegal without making the move).
>
>I do not use copy and paste but the code that I wrote for InputMove is clearly
>influenced by crafty and I cannot say that it is independent.
>
>1)I used some names of variables from Crafty's code because I was lazy to try to
>think  about better names.
>
>2)I did not know about the function strchr that is used in Crafty before reading
>crafty's code
>
>I give the code that I have so far at the bottom of this post
>
>I was interested in the past if there is some free code that I can use for the
>purpose of reading pgn but it seems that the answer is negative and every
>programmer needs to reinvent the wheel again even when the tasks are
>deterministic tasks like reading pgn and getting specific output in format that
>is more easy for  programs and there is no free source file that programmers are
>allowed to use in order to translate pgn to another format that is more friendly
>for chess programs.
>
>int InputMove(char  *text)
>{
>	int ffile,frank,tfile,trank;
>	int piece,capture,promote;
>	char movetext[64];
>	char* lasttext;
>	if (strlen(text)==0)
>		return 0;
>	if (strlen(text)>=4)
>	if ((text[0]>='a')&&(text[0]<='h')&&
>		(text[1]>='1')&&(text[1]<='8')&&
>		(text[2]>='a')&&(text[2]<='h')&&
>		(text[3]>='1')&&(text[3]<='8'))
>		return makeusermove(text);
>	piece=PAWN;
>	capture=0;
>	promote=0;
>	frank=-1;
>	ffile=-1;
>	trank=-1;
>	tfile=-1;
>	strcpy(movetext,text);
>	/*deleting irrelevant chars from movetext like checks and mates that I ignore
>and
>	must appear at the end of the text*/
>	if (strchr(movetext,'#'))
>		*strchr(movetext,'#')=0;
>	/*I deleted  mate and chars after mate and I continue for checks and
>promotions*/
>	if (strchr(movetext,'+'))
>		*strchr(movetext,'+')=0;
>	printf(" %d ", strlen(movetext));
>	printf(" %s ",movetext);
>	if (strchr(movetext,'='))
>	{
>		lasttext=strchr(movetext,'=');
>		if (strlen(lasttext)<2)
>			return 0;
>		switch (lasttext[1])
>		{
>		case 'q':promote=QUEEN;
>			break;
>		case 'n':promote=KNIGHT;
>			break;
>		case 'b':promote=BISHOP;
>			break;
>		case 'r':promote=ROOK;
>			break;
>		}
>		*strchr(movetext,'=')=0;
>
>	}
>	return 0;
>
>}

Note that the printf that I have is only for checking that the code is working
correctly because I was not sure exactly what a thing like
*strchr(movetext,'+')=0; does and I used printf to verify it.

I understand that it means that the pointer give end of string at that point
because 0 is translated to char that the meaning of it is end of string so
having that char also reduce the length of the string.

Uri



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.