/*
	scrab.h - includes, defines and structures
*/

#include "xlescrab.h"
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

#include <assert.h>

/* make sure this is bigger than the number of words in the dictionary used -
   129000 is okay for the french dictionary.
*/
#define DICTSIZE 129000


#define NAMELEN 14
#define BARLEN 7
#define BOARDSIZE 15
/* OK for french: */
#define BAGSIZE 102 /* must be the same as sum of letter frequency */
#define MAXPLAYERS 4
#define NUMLETTERS 26
/* OK for french: */
#define LETTER_FREQUENCY_TABLE {9,2,2,3,15,2,2,2,8,1,1,5,3,6,6,2,1,6,6,6,6,2,1,1,1,1}
#define LETTER_SCORES {1,3,3,2,1,4,2,4,1,8,10,1,2,1,1,3,8,1,1,1,1,4,10,10,10,10}

#define SAVENAME "/.xlescrabble.save"

#define MAXPATHLEN 256
#define MAGNUM 99 /* magic number for checksum calculation */
/*TODO: adapt here ? */
#define BLANKTILES {'a','e','i','o','s','t'}
#define NUMBLANKS 6
#define NUMHIGHSCORES 8
#define NUMGOSCORES 10
#define BESTGOWORDSLEN 30

/* define MAKEPERMS if you would rather have the permutations created at runtime*/
#ifdef MAKEPERMS 
#undef MAKEPERMS
#endif

/* board validation flags */
#define INVALID 0  /* invalid words */
#define VALID 1    /* valid words */
#define HORLICKS 2 /* move was complete horlicks */
#define NOTCENTRE 3 /* first move was not in centre */

/* player statistics structure */
typedef struct { int score;
		 char name[NAMELEN];
		 char bar[BARLEN]; } playerStat;

typedef struct { int score;
		 char name[NAMELEN];
		 time_t date; } scoreStat;
		 
typedef struct { int score;
		 char name[NAMELEN];
		 time_t date;
		 char words[BESTGOWORDSLEN]; } goStat;
