tak/tak.h

76 lines
2.7 KiB
C

#define MAXBOARDSTRLEN 20
void init(void);
int setupgame(int sz,int nrounds);
int setupround(void);
void line(void);
void cleanup(void);
char getmod(char *stack);
int hasmod(char *stack);
char getmodxy(int x, int y);
char getowner(char *stack);
int ismod(char ch);
int isdir(char ch);
char *getdirname(int dir);
char *getmodname(int mod);
void showboard(void);
char *readcmd(char *cmd);
int parsecmd(char *cmd);
int placetile(int who,char xch,char ych, char mod);
int nextround(void);
int nextturn(void);
char getpchar(int n);
char *getpcol(int pnum);
char modprintable(char mod);
char *getpstr(int n);
char *getpname(int n);
void dirtoxy(char dir, int *x, int *y);
int movetile(int count,char xch,char ych, char dir, char *dropstr);
int getstarttiles(int sz);
int getstartcapstones(int sz);
void determinewinner(void);
int isvalidxypos(char x, char y);
int isvalidxy(int x, int y);
void showboardbinary(int pnum);
int xtoleftshift(int num);
void printbinaryline(char prefix, int num, int wantcr);
int playerhasroads(int pnum, char (*b)[]);
void updateroadstatus(void);
char *makecolorstr(char *orig, char *newstr, int boldidx);
void showscores(char *str);
int checkxyforroad(char (*b)[], int who, int sx, int sy, int sd);
void pickfirstplayer(void);
int xyvalidforroad(char (*b)[], int who, int x, int y);
void logmove(int who, char *txt, char append);
int normalise(char *a);
char *genaicmd(char *cmd, int showdb, int useworst);
int canplacetile(int who, int x, int y, int mod, char *why);
int canmoveto(int who, int x, int y, char *why);
void idxtoxy(int idx, int *x, int *y);
void xytopos(int x, int y, int *xch, int *ych);
int gotwinner(void);
int xywouldgivewinto(int who, int tx, int ty);
int modaivalue(int x,int y,int amt, char *reason);
int modaivalue_around(int x,int y,int amt, char *reason);
int modaidef(int x,int y,int amt);
int modaidef_around(int x,int y,int amt);
int canmovefrom(int who, int x, int y, char *why);
int willmovefrom(int who, int x, int y, char *why);
int canmoveanyto(int who, int x, int y, char *why, int safe);
int canmakedropstr(int who, int sx, int sy, int dx, int dy, char *str);
char getdirchar(int dir);
void showaivalues(int best);
int countadjacent(int x, int y, int who);
int getpnum(int n);
int countownedinrow(int sx, int sy, int who);
int countownedincol(int sx, int sy, int who);
int pctchance(int num);
int colhasmod(int sx, int sy, char mod, int who);
int rowhasmod(int sx, int sy, char mod, int who);
void determinefinalwinner(void);
void roadlog(char *dname, int dir, int xch, int ych, int newx, int newy);
char getownerxy(int x, int y);
int getownernumxy(int x, int y);
void checkfortak(int who);
void showboardrow(char (*b)[MAXBOARDSTRLEN], int y);
void setlastmove(int x,int y,int ntiles);