home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / games / gnugo / c / sethand < prev    next >
Encoding:
Text File  |  1995-03-11  |  2.3 KB  |  103 lines

  1. /*
  2.                 GNU GO - the game of Go (Wei-Chi)
  3.                 Version 1.1   last revised 3-1-89
  4.            Copyright (C) Free Software Foundation, Inc.
  5.                       written by Man L. Li
  6.                       modified by Wayne Iba
  7.                     documented by Bob Webber
  8. */
  9. /*
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation - version 1.
  13.  
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. GNU General Public License in file COPYING for more details.
  18.  
  19. You should have received a copy of the GNU General Public License
  20. along with this program; if not, write to the Free Software
  21. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  
  23. Please report any bug/fix, modification, suggestion to
  24.  
  25. mail address:   Man L. Li
  26.                 Dept. of Computer Science
  27.                 University of Houston
  28.                 4800 Calhoun Road
  29.                 Houston, TX 77004
  30.  
  31. e-mail address: manli@cs.uh.edu         (Internet)
  32.                 coscgbn@uhvax1.bitnet   (BITNET)
  33.                 70070,404               (CompuServe)
  34. */
  35.  
  36. #include <stdio.h>
  37. #include "header.h"
  38.  
  39.  
  40. void sethand(i)
  41. /* set up handicap pieces */
  42. int i;
  43.  
  44. {
  45.  if (i > 0)
  46.    {
  47.     p[3][3] = BLACK;
  48.     if (i > 1)
  49.       {
  50.        p[15][15] = BLACK;
  51.        if (i > 2)
  52.      {
  53.       p[3][15] = BLACK;
  54.       if (i > 3)
  55.         {
  56.          p[15][3] = BLACK;
  57.          if (i == 5)
  58.         p[9][9] = BLACK;
  59.          else
  60.         if (i > 5)
  61.           {
  62.            p[9][15] = BLACK;
  63.            p[9][3] = BLACK;
  64.            if (i == 7)
  65.               p[9][9] = BLACK;
  66.            else
  67.               if (i > 7)
  68.             {
  69.              p[15][9] = BLACK;
  70.              p[3][9] = BLACK;
  71.              if (i > 8)
  72.              p[9][9] = BLACK;
  73.               if (i > 9)
  74.                 {p[2][2] = 2;
  75.                  if (i > 10)
  76.                    {p[16][16] = 2;
  77.                     if (i > 11)
  78.                   {p[2][16] = 2;
  79.                    if (i > 12)
  80.                      {p[16][2] = 2;
  81.                       if (i > 13)
  82.                         {p[6][6] = 2;
  83.                      if (i > 14)
  84.                        {p[12][12] = 2;
  85.                         if (i > 15)
  86.                           {p[6][12] = 2;
  87.                            if (i > 16)
  88.                          p[12][6] = 2;
  89.                          }
  90.                       }
  91.                        }
  92.                     }
  93.                  }
  94.                   }
  95.                }
  96.                }
  97.          }
  98.        }
  99.     }
  100.      }
  101.   }
  102. }  /* end sethand */
  103.