It should, however, be noted that it reflects the results of a very cautious strategy that is not necessarily good against bad players or players acting according to another principle of optimality. Suppose, for example, there are two moves in position p1 and p2, and p1 guarantees a draw (win 0) and does not make it possible to win, while p2 makes it possible to win if the opponent sees a very subtle winning move. In such a situation, we can prefer the risky move to p2, if only we are not sure that our opponent is omnipotent and omniscient. It is very possible that people win over chess programs in exactly this way.
int F( void *p)
{
int res,i,t,d,m;
// ps ( d)
possibles(p, ps, &d);
if (!d) res=f(p) else
{
m = -infinity;
for (i=1;i<=d;i++)
{
t = -F(ps[i]);
if (t > m) m=t;
}
res = m;
}
return res
* This source code was highlighted with Source Code Highlighter .
int F1( void *p, int bound)
{
int res,i,t,d,m;
// ps ( d)
possibles(p, ps, &d);
if (!d) res=f(p) else
{
m = -infinity;
for (i=1;(i<=d) && (m<bound);i++)
{
t = -F1(ps[i],-m);
if (t > m) m=t;
}
res = m;
}
return res;
}
* This source code was highlighted with Source Code Highlighter .
int F1( void *p, int alpha, int beta)
{
int res,i,t,d,m;
// ps ( d)
possibles(p, ps, &d);
if (!d) res=f(p) else
{
m = alpha;
for (i=1;(i<=d) && (m<beta);i++)
{
t = -F2(ps[i],-beta,-m);
if (t > m) m=t;
}
res = m;
}
return res;
}
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/51076/