-/* $NetBSD: gomoku.h,v 1.9 2004/01/27 20:25:48 jsm Exp $ */
+/* $NetBSD: gomoku.h,v 1.19 2010/03/29 04:28:47 dholland Exp $ */
/*
* Copyright (c) 1994
#define BSZ 19
#define BSZ1 (BSZ+1)
#define BSZ2 (BSZ+2)
+#define BSZ3 (BSZ+3)
+#define BSZ4 (BSZ+4)
#define BAREA (BSZ2*BSZ1+1)
-/* frame dimentions (based on 5 in a row) */
+#define TRANSCRIPT_COL 46 /* necessarily == 2*BSZ4 */
+
+/* interactive curses stuff */
+#define BGOTO(y,x) move(BSZ - (y), 2 * (x) + 3)
+
+/* frame dimensions (based on 5 in a row) */
#define FSZ1 BSZ
#define FSZ2 (BSZ-4)
#define FAREA (FSZ1*FSZ2 + FSZ2*FSZ2 + FSZ1*FSZ2 + FSZ2*FSZ2)
u_short c_vertex; /* C:intersection or F:frame head */
u_char c_nframes; /* number of frames in the combo */
u_char c_dir; /* C:loop frame or F:frame direction */
- u_char c_flg; /* C:combo flags */
+ u_char c_flags; /* C:combo flags */
u_char c_frameindex; /* C:intersection frame index */
u_char c_framecnt[2]; /* number of frames left to attach */
u_char c_emask[2]; /* C:bit mask of completion spots for
u_char c_voff[2]; /* C:vertex offset within frame */
};
-/* flag values for c_flg */
+/* flag values for c_flags */
#define C_OPEN_0 0x01 /* link[0] is an open ended frame */
#define C_OPEN_1 0x02 /* link[1] is an open ended frame */
#define C_LOOP 0x04 /* link[1] intersects previous frame */
struct spotstr {
short s_occ; /* color of occupant */
short s_wval; /* weighted value */
- int s_flg; /* flags for graph walks */
+ int s_flags; /* flags for graph walks */
struct combostr *s_frame[4]; /* level 1 combo for frame[dir] */
union comboval s_fval[2][4]; /* combo value for [color][frame] */
union comboval s_combo[2]; /* minimum combo value for BLK & WHT */
int dummy[2]; /* XXX */
};
-/* flag values for s_flg */
+/* flag values for s_flags */
#define CFLAG 0x000001 /* frame is part of a combo */
#define CFLAGALL 0x00000F /* all frame directions marked */
#define IFLAG 0x000010 /* legal intersection point */
/*
* This structure is used to store overlap information between frames.
*/
-struct ovlp_info {
+struct overlap_info {
int o_intersect; /* intersection spot */
struct combostr *o_fcombo; /* the connecting combo */
u_char o_link; /* which link to update (0 or 1) */
};
extern const char *letters;
-extern char fmtbuf[];
extern const char pdir[];
extern const int dd[4];
#define ASSERT(x)
-void bdinit __P((struct spotstr *));
-void init_overlap __P((void));
-int getline __P((char *, int));
-void ask __P((const char *));
-void dislog __P((const char *));
-void bdump __P((FILE *));
-void bdisp __P((void));
-void bdisp_init __P((void));
-void cursfini __P((void));
-void cursinit __P((void));
-void bdwho __P((int));
-void panic __P((const char *)) __attribute__((__noreturn__));
-void glog __P((const char *));
-void dlog __P((const char *));
-void quit __P((void)) __attribute__((__noreturn__));
-void quitsig __P((int)) __attribute__((__noreturn__));
-void whatsup __P((int));
-int readinput __P((FILE *));
-const char *stoc __P((int));
-int lton __P((int));
-int ctos __P((const char *));
-void update_overlap __P((struct spotstr *));
-int makemove __P((int, int));
-int list_eq __P((struct combostr **, struct combostr **, int));
-void clearcombo __P((struct combostr *, int));
-void makeempty __P((struct combostr *));
-void appendcombo __P((struct combostr *, int));
-void updatecombo __P((struct combostr *, int));
-void markcombo __P((struct combostr *));
-void printcombo __P((struct combostr *, char *));
-void makecombo __P((struct combostr *, struct spotstr *, int, int));
-void makecombo2 __P((struct combostr *, struct spotstr *, int, int));
-int sortcombo __P((struct combostr **, struct combostr **, struct combostr *));
-int checkframes __P((struct combostr *, struct combostr *, struct spotstr *,
-int, struct ovlp_info *));
-void addframes __P((int));
-void scanframes __P((int));
-int better __P((const struct spotstr *, const struct spotstr *, int));
-int pickmove __P((int));
+void bdinit(struct spotstr *);
+int get_coord(void);
+int get_key(const char *allowedkeys);
+int get_line(char *, int);
+void ask(const char *);
+void dislog(const char *);
+void bdump(FILE *);
+void bdisp(void);
+void bdisp_init(void);
+void cursfini(void);
+void cursinit(void);
+void bdwho(int);
+void panic(const char *, ...) __printflike(1, 2) __dead;
+void debuglog(const char *, ...) __printflike(1, 2);
+void whatsup(int);
+const char *stoc(int);
+int ctos(const char *);
+int makemove(int, int);
+int list_eq(struct combostr **, struct combostr **, int);
+void clearcombo(struct combostr *, int);
+void markcombo(struct combostr *);
+int pickmove(int);