Plan 9 from Bell Labs’s /usr/web/sources/contrib/paurea/goban/igo.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.




enum{
/* Colouring of stones */
/* marked for dead are tolower of normal*/
	Hcapplay='A',		//Hcap
	Emptystone='e',		//empty stone
	Wmarked='w',		//marked white
	Bmarked='b',		//marked black
	Lstone='l',		//Mark for the last stone
	Kou='k',		//Kou
	Cntstone='c',		//Count point
	Bstone='B',		//Black stone
	Wstone='W',		//White stone
	Nop='N',		//Nop
/* Special moves */
	Chplayer='O',		//Change player
	Resignmv='F',		//Resign
	Chmode='C',		//Change mode to end, count
	Mdead='D',		//Mark dead, count
};

extern char *emptytype;
extern int verbose;
#define dprint if(verbose)print


enum {
	Stacksz = 1024*1024,
};

enum {
	Bansz=19,
};

typedef struct Move Move;
struct Move{
	Point;  /* this is i,j in goban in Go coordinates, starting in 1,1 */
	char type;
	Move *next;
};


// move.c

void	fillmov(Move *m, Point pos, char type);
void	freegrp(Move *m);
int	opgrp(Move *grp, char type, void (*op)(Move *m, char type));
Move*	clonegrp(Move *grp);
Move*	addlast(Move *g,Move *m);
Move*	pushmov(Move *g, Move *m);
Move*	popmov(Move **m, Move *g);

void	opprint(Move *m, char);
void	opdebug(Move *m,char);
void	opplace(Move *m, char type);
void	opsend(Move *mv,char);
void	opsettype(Move *m, char c);
void	opnop(Move *,char);

Move*	freelast(Move *g);
Move* 	takelast(Move **grp);

// rules.c

void 		cleangoban(void);
Move*		getmove(Point pos);
int		nlibert(Move *m);
int		move(Move *m, Move **mdead);
int		countpos(Move *m, Move **terr, char *type);
Move*		getgrp(Move *m, char *neightype);
void		opplace(Move *m, char type);
int		markdead(Move *m,Move **mdead);
int		trycount(int *nw, int *nb);
int		isvalidpos(Point pos);
void		cleartype(char type);

enum {
	Hcapsz=9
};

void	inthread(void *);
void	ifcthread(void *);

extern Point hcap[Hcapsz];
extern Point hcapord[Hcapsz][Hcapsz];
extern char goban[Bansz+1][Bansz+1];
extern Move lkou;
extern Move lstone;
extern Move *moves;

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.