1 /* 2 scrab.h - includes, defines and structures 3 */ 4 5 #include "xscrab.h" 6 #include <stdio.h> 7 #include <ctype.h> 8 #include <time.h> 9 #include <stdlib.h> 10 #include <sys/types.h> 11 #include <unistd.h> 12 13 #include <assert.h> 14 15 /* make sure this is bigger than the number of words in the dictionary used - 16 119000 is okay for the supplied dictionary. 17 */ 18 19 #define NUMCHAR_MAX 256 20 #define NUMLETTERS_MAX 100 21 #define NUMBLANKS_MAX 20 22 #define BAGSIZE_MAX 200 23 24 #define NAMELEN 64 25 #define BARLEN 7 26 #define BOARDSIZE 15 27 #define MAXPLAYERS 4 28 29 #define SAVENAME "/.xscrabble.save" 30 31 #define MAXPATHLEN 256 32 #define MAGNUM 99 /* magic number for checksum calculation */ 33 #define NUMHIGHSCORES 8 34 #define NUMGOSCORES 10 35 #define BESTGOWORDSLEN 30 36 37 /* board validation flags */ 38 #define INVALID 0 /* invalid words */ 39 #define VALID 1 /* valid words */ 40 #define HORLICKS 2 /* move was complete horlicks */ 41 #define NOTCENTRE 3 /* first move was not in centre */ 42 43 /* player statistics structure */ 44 typedef struct { int score; 45 char name[NAMELEN]; 46 char bar[BARLEN]; } playerStat; 47 48 typedef struct { int score; 49 char name[NAMELEN]; 50 time_t date; } scoreStat; 51 52 typedef struct { int score; 53 char name[NAMELEN]; 54 time_t date; 55 char words[BESTGOWORDSLEN]; } goStat; 56