Author: Matthias Gemuh
Date: 10:27:06 01/05/03
Go up one level in this thread
On January 05, 2003 at 12:50:43, Normand M. Blais wrote:
>Hi,
>
>After seeing how others do "perft", I thought I'd share the way I do it. It is
>less sophisticated but I think it is easy for "everybody" to understand.
>
>
>int chess::perft_nodes[8];
>
>void chess::perft(int d)
>{
> if (d == 0) return;
>
> gen_caps(p->side,p->ply);
> gen_moves(p->side,p->ply);
>
> for (int i=g->list_idx[p->ply]; i<g->list_idx[p->ply+1]; i++) {
> if (p->make(g->move_list[i].m)) {
> perft_nodes[p->ply]++;
> perft(d-1);
> p->unmake();
> }
> }
>}
>
>
My guess is that 97% of us do it same way (decreasing d), while 3% go from d=1
upwards. I don't see alternative ways.
/Matthias.
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.