Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Correction..

Author: Matthias Gemuh

Date: 14:32:23 03/16/04

Go up one level in this thread


On March 16, 2004 at 17:20:56, Andrew Williams wrote:
>
>int perft(int ply, int depth) {
>	int legalPosition;
>	int mvNum;
>	move mv;
>	int inCheck;
>
>	abNodes++;
>	if(ply > depth) qNodes++;
>	if(ply > depth || ply >= MAX_DEPTH) {
>		return 0;
>	}
>
>	plystart[ply+1] = plystart[ply];
>
>	inCheck = in_check(whoseTurn);
>	if(inCheck) {
>		legalPosition = get_me_out_of_check(ply);
>	} else {
>		legalPosition = generate_moves(whoseTurn, ply);
>	}
>	if(legalPosition == FALSE) return -ILLEGAL_POSITION;
>//	sort_tree(ply);
>	mvNum = plystart[ply];
>
>	while(mvNum < plystart[ply+1]) {
>		mv = tree[mvNum].mv;
>		if(ply == 1) {
>			print_move(mv);
>			fprintf(logFile, "\n");
>		}
>		make_move(mv);
>		if(in_check(OTHERSIDE(whoseTurn))) {
>			unmake_move();
>			mvNum++;
>			continue;
>		}
>
>                tree[mvNum].score = -perft(ply+1, depth);
>		unmake_move();
>
>		mvNum++;
>    }
>
>	return 0;
>}
>
>
>Cheers
>
>Andrew




Unfortunately I cannot exclude the generation of attackboards.
What is your Athlon's GHz ?






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.