home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Games / NeXTGo-3.0-MIS / eval.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-06  |  657 b   |  34 lines

  1. #include "comment.header"
  2.  
  3. /* $Id: eval.c,v 1.3 1997/07/06 19:34:54 ergo Exp $ */
  4.  
  5. /*
  6.  * $Log: eval.c,v $
  7.  * Revision 1.3  1997/07/06 19:34:54  ergo
  8.  * actual version
  9.  *
  10.  * Revision 1.2  1997/05/04 18:56:59  ergo
  11.  * added time control for moves
  12.  *
  13.  */
  14.  
  15. extern unsigned char p[19][19], l[19][19];
  16. extern int lib, MAXX, MAXY;
  17. extern void countlib(int i, int j, int color);
  18.  
  19. void eval(int color)
  20.      /* evaluate liberty of color pieces */
  21. {
  22.   int i, j;
  23.   
  24.   /* find liberty of each piece */
  25.   for (i = 0; i < MAXX; i++)
  26.     for (j = 0; j < MAXY; j++)
  27.       if (p[i][j] == color)
  28.     {
  29.       lib = 0;
  30.       countlib(i, j, color);
  31.       l[i][j] = lib;
  32.     }
  33. }  /* end eval */
  34.