home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 501.lha / Mosaic / mosaic.h < prev    next >
C/C++ Source or Header  |  1991-04-08  |  2KB  |  66 lines

  1. /*
  2.  * mosaic.h
  3.  * kirk johnson
  4.  * october 1990
  5.  */
  6.  
  7. #ifndef _MOSAIC_H_
  8. #define _MOSAIC_H_
  9.  
  10. #include <stdio.h>
  11.  
  12. /* #define DEBUG */
  13.  
  14. #define AppName   "mosaic"
  15.  
  16. #define BoardSize (24)        /* width, in tiles */
  17. #define NPieces   (81)        /* # pieces per game */
  18.  
  19. #define NTiles (BoardSize*BoardSize)
  20.  
  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 */
  25.  
  26. #define MaxPossibleScore  "34992"
  27.  
  28.  
  29. typedef unsigned short Word;
  30.  
  31. typedef struct
  32. {
  33.   char uname[MaxUnameLen+1];    /* username */
  34.   int  score;            /* score */
  35. } NameAndScore;
  36.  
  37. void MoveBox (int MouseX, int MouseY);
  38. void main (void);
  39. void QuitGame(int rc);
  40. void warning(char *msg);
  41. void fatal(char *msg);
  42. void ReadHighScores(void);
  43. void WriteHighScores(void);
  44. void CheckHighScore(void);
  45. void AutoPlay(void);
  46. void UpdateAndScore(int r, int c, Word score[]);
  47. void PossiblyMerge(int i, int j);
  48. int DropPiece(int r, int c, Word p);
  49. void InitGame(void);
  50. void drawTile(int r, int c);
  51. void drawHighScores(void);
  52. void drawNext(void);
  53. void drawScore(void);
  54.  
  55. extern Word tile[NTiles];    /* the board */
  56. extern Word piece[NPieces];    /* the "deck" of pieces */
  57. extern Word nextpiece;        /* index into the deck */
  58.  
  59. extern Word tscore[3];        /* total score */
  60. extern Word pscore[3];        /* last piece score */
  61. extern Word remain[3];        /* tiles remaining */
  62.  
  63. extern NameAndScore highscore[NHighScores];
  64.  
  65. #endif /* _MOSAIC_H_ */
  66.