14 #define AppName "mosaic"
16 #define BoardSize (24) /* width, in tiles */
17 #define NPieces (81) /* # pieces per game */
19 #define NTiles (BoardSize*BoardSize)
21 #define MaxUnameLen (30) /* eight chars per uname, max */
22 #define MaxScoreLen (5) /* five chars per score, max */
23 #define NHighScores (10) /* # of high scores kept */
24 #define NHelpLines (10) /* # of lines in help window */
26 #define MaxPossibleScore "34992"
29 typedef unsigned short Word
;
33 char uname
[MaxUnameLen
+1]; /* username */
34 int score
; /* score */
37 void MoveBox (int MouseX
, int MouseY
);
38 void QuitGame(int rc
);
39 void warning(char *msg
);
40 void fatal(char *msg
);
41 void ReadHighScores(void);
42 void WriteHighScores(void);
43 void CheckHighScore(void);
45 void UpdateAndScore(int r
, int c
, Word score
[]);
46 void PossiblyMerge(int i
, int j
);
47 int DropPiece(int r
, int c
, Word p
);
49 void drawTile(int r
, int c
);
50 void drawHighScores(void);
54 extern Word tile
[NTiles
]; /* the board */
55 extern Word piece
[NPieces
]; /* the "deck" of pieces */
56 extern Word nextpiece
; /* index into the deck */
58 extern Word tscore
[3]; /* total score */
59 extern Word pscore
[3]; /* last piece score */
60 extern Word remain
[3]; /* tiles remaining */
62 extern NameAndScore highscore
[NHighScores
];
64 #endif /* _MOSAIC_H_ */