File: Hint.c

package info (click to toggle)
gtkgo 0.0.10-12
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,836 kB
  • ctags: 617
  • sloc: ansic: 8,552; sh: 327; makefile: 221
file content (73 lines) | stat: -rw-r--r-- 1,866 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* gtkgo 0.0.10 (Hint.c) - 05/17/99
 * Copyright (C) 1998, 1999  Norbert de Jonge
 * (hack@altavista.net)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this game; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

#include "Hint.h"

void Hint (void)
{
  /* The next 4 lines must be there. */
  while (gtk_events_pending ())
  {
    gtk_main_iteration ();
  }
  if (ichangestuff == 0)
  {
    Play ("click.mp3", 0);
  }
  if ((((ifilestuff == 0) && ((biscomputer == 0) || (wiscomputer == 0)) &&
    (iyesno == 0)) && (((((Modulo (imoves, 2) == 0) && (iiamblack == 1)) ||
    ((Modulo (imoves, 2) != 0) && (iiamblack == 0))) && (inet == 1)) ||
    (inet == 0))) && (imoving == 0))
  {
    imoving = 1;
    if (Modulo (imoves, 2) == 0)
    {
      if (inet == 1) idohint = 1;
      Computer ('b');
      idohint = 0;
      JudgeBoard ('w');
      if (wiscomputer == 1)
      {
        Computer ('w');
        JudgeBoard ('b');
      }
    }
    else
    {
      if (inet == 1) idohint = 1;
      Computer ('w');
      idohint = 0;
      JudgeBoard ('b');
      if (biscomputer == 1)
      {
        Computer ('b');
        JudgeBoard ('w');
      }
    }
    imoving = 0;
  }
  else
  {
    if (inet == 1)
    {
      Message ("It is not your move.", 3, 0);
    }
  }
}