00001 /********************************************************************** 00002 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 /* AmiGo Include */ 00021 /* MSG types for getinput() */ 00022 00023 #ifndef __go_h 00024 #define __go_h 00025 00026 00027 #define INTERSECTIONMSG 1 /* User buttoned an intersection */ 00028 #define QUITMSG 2 /* User buttoned QUIT icon */ 00029 #define PLAYMSG 3 00030 #define RESTARTMSG 4 00031 #define PASSMSG 5 00032 00033 #define TRUE 1 00034 #define FALSE 0 00035 00036 #define MAXGROUPS 100 00037 00038 #define PLACED 0 00039 #define REMOVED 1 00040 00041 #define numPoints 19 00042 #define maxPoint numPoints - 1 00043 00044 /*-- definitions used when counting up --*/ 00045 00046 #define CNT_UNDECIDED 0 00047 #define CNT_BLACK_TERR 1 00048 #define CNT_WHITE_TERR 2 00049 #define CNT_NOONE 3 00050 00051 /*-- macro functions --*/ 00052 00053 #define LegalPoint(x,y) (x>=0 && x<=18 && y>=0 && y<=18) 00054 #define ForeachPoint(a,b) for(a=0;a<19;a++) for (b=0;b<19;b++) 00055 00056 enum bVal {BLACK, WHITE, EMPTY}; 00057 typedef enum bVal sType; 00058 struct Group 00059 { 00060 enum bVal color; /* The color of the group */ 00061 short code, /* The code used to mark stones in the group */ 00062 count, /* The number of stones in the group */ 00063 internal, /* The number of internal liberties */ 00064 external, /* The number of external liberties */ 00065 liberties, /* The total number of liberties */ 00066 eyes, /* The number of eyes */ 00067 alive, /* A judgement of how alive this group is */ 00068 territory; /* The territory this group controls */ 00069 }; 00070 00071 struct bRec 00072 { 00073 enum bVal Val; /* What is at this intersection */ 00074 short xOfs, 00075 yOfs; 00076 short mNum; 00077 short GroupNum; /* What group the stone belongs to */ 00078 short marked; /* TRUE or FALSE */ 00079 }; 00080 00081 #endif
1.4.2