/* XScrabble v2.00 init.c initialisation routines By csuos@warwick.ac.uk */ #include "scrab.h" #include "globals.h" char board[BOARDSIZE][BOARDSIZE]; extern char bag[BAGSIZE_MAX]; extern int bagptr; /* to be initialized as bagptr = BAGSIZE-1; */ scoreStat highscores[4][NUMHIGHSCORES]; int num_players; playerStat player[MAXPLAYERS];/* for the coloured squares, and bonues */ int curr_player = 0; /* 0 = normal square (green) 1 = double letter (skyblue) 2 = triple letter (dark blue) 3 = double word (orange) 4 = triple word (red) */ int sq_col[BOARDSIZE][BOARDSIZE] = { {4,0,0,1,0,0,0,4,0,0,0,1,0,0,4}, {0,3,0,0,0,2,0,0,0,2,0,0,0,3,0}, {0,0,3,0,0,0,1,0,1,0,0,0,3,0,0}, {1,0,0,3,0,0,0,1,0,0,0,3,0,0,1}, {0,0,0,0,3,0,0,0,0,0,3,0,0,0,0}, {0,2,0,0,0,2,0,0,0,2,0,0,0,2,0}, {0,0,1,0,0,0,1,0,1,0,0,0,1,0,0}, {4,0,0,1,0,0,0,3,0,0,0,1,0,0,4}, {0,0,1,0,0,0,1,0,1,0,0,0,1,0,0}, {0,2,0,0,0,2,0,0,0,2,0,0,0,2,0}, {0,0,0,0,3,0,0,0,0,0,3,0,0,0,0}, {1,0,0,3,0,0,0,1,0,0,0,3,0,0,1}, {0,0,3,0,0,0,1,0,1,0,0,0,3,0,0}, {0,3,0,0,0,2,0,0,0,2,0,0,0,3,0}, {4,0,0,1,0,0,0,4,0,0,0,1,0,0,4} }; extern int letterscore[NUMCHAR_MAX]; /* The dictionary */ char **dict; int word_pos[15]; /* the permutation lists */ short int perms[5040][7]; int factorial[7]; int norms[6][7] = { {0,0,0,10,0,0,0}, {0,0,5,20,5,0,0}, {0,0,10,20,40,5,0}, {20,40,60,80,100,10,5}, {20,40,60,80,100,120,5}, {20,40,60,80,100,120,60} }; int norms_max[6] = {9,29,74,314,424,479}; /* sum of the normal distribution values -1 */ goStat bestgos[NUMGOSCORES];