Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: ETC

Author: Murray

Date: 05:04:22 12/04/02

Go up one level in this thread


(snip)

>I hate this crap. That's why I threw etc out.
>
>Tony
>

Its a little tricky but here's the way I do it, a little simplified. It helps to
get hash_retrieve() to do the work on deciding if the hash_score is useable or
not.

	//depth = depth (in whole plies) into tree, 0 = start position
	//todo = distance (in whole plies) to go before qsearch begins
	//Position this code before the main "move" loop that recursively
	//calls alphabeta

	if (todo > ETC_PARAM)
	{
		int val ;

		generate_moves() ;

		while (legal_moves_left)
		{
			get_next_move() ;
			do_current_move() ;

			val = hash_retrieve(child_position, todo - 1, -beta, -alpha) ;
			if (val != hashUNKNOWN && -val >= beta)
				return (-val); //ETC cutoff

			undo_current_move() ;
		}
	}

	int hash_retrieve(pos, todo, alpha, beta)
	{
		if (matching_hash() && sufficient_hash_todo())
		{
			//hash_score, hash_sign are from the hash record
			if ((hash_sign == SIGN_EQ)
			|| (hash_sign == SIGN_LTE && hash_score <= alpha)
			|| (hash_sign == SIGN_GTE && hash_score >= beta))
				return (hash_score) ;
		}
		return hashUNKNOWN ; // (a constant outside the possible score range)
	}



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.