home *** CD-ROM | disk | FTP | other *** search
/ CD PowerPlay 6 / TheCompleteAdventureCollection1995 / CDPP6.ISO / hints / 7thg / winmicro / protos.h < prev   
Encoding:
C/C++ Source or Header  |  1995-06-30  |  2.4 KB  |  74 lines

  1. #include <dos.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <ctype.h>
  5. #include <time.h>
  6. #include <alloc.h>
  7. #include <mem.h>
  8. #include <conio.h>
  9. #include <process.h>
  10.  
  11. #define MAXCOL 6
  12. #define MINCOL 0
  13. #define MAXROW 6
  14. #define MINROW 0
  15. #define FALSE 0
  16. #define TRUE 1
  17. #define PIECEWEIGHT 2
  18.  
  19. typedef enum Tsquare {EMPTYSQ=0,BLUESQ=1,GREENSQ=2} Tsquare;
  20.  
  21. typedef struct Tmovelist{
  22.     struct Tmovelist *next;              // reply
  23.     char from;                           // 0=top/left square   48=bot/right
  24.     char to;
  25.     char jump;                           // is a jump?
  26.     }Tmovelist;
  27.  
  28. typedef union Tboard{
  29.     Tsquare board[7][7];                 // row/col type access
  30.     Tsquare b[49];                       // 0 to 48 type access
  31.     } Tboard;
  32.  
  33. typedef struct Tcurrent                // current board/score
  34.     {
  35.     Tsquare color;                      // whose turn to move
  36.     char countblue;                     // number of blue pieces on board
  37.     char counttotal;                    // total number of pieces on board
  38.     Tboard board;                       // playing board
  39.     } Tcurrent;
  40.  
  41. typedef struct TWindow2{              // precomputed 2 square area around
  42.     char a[50][26];                    // each sqaure on board
  43. }TWindow2;
  44.  
  45. typedef struct Window1{              // precomputed 1 square area around
  46.     char a[50][9];                    // each square on board
  47. }TWindow1;
  48.  
  49. // ******** Function prototypes ******************
  50.  
  51. void prtmove(Tmovelist *movelist);
  52. void printmove(Tmovelist *movelist);
  53. Tmovelist *allocmovelist(void);
  54. Tcurrent *allocTboard(void);
  55. char emptysquare(Tcurrent *a);
  56. void freeTboard(Tcurrent *aboard);
  57. void init_stack_count(void);       // for debug
  58. void stack_count(void);            // for debug
  59. void heapchk(void);                // for debug
  60. void initwindow2(void);
  61. void initwindow1(void);
  62. void printboard(Tcurrent *a);
  63. void printmovelist(Tmovelist *movelist);
  64. void print_bestmove(Tmovelist *movelist);
  65. Tmovelist* findmoves(Tcurrent far *a,char level,int far *bestscore);
  66. Tmovelist *getmovelist(Tcurrent *a, Tsquare color);
  67. void initboard(Tcurrent* a);
  68. char scoremove(Tcurrent a,Tsquare color,char torow,char tocol,char *score);
  69. void makemove(Tcurrent *a,Tmovelist *movelist);
  70. char getsquare(void);
  71. Tmovelist getmove(Tcurrent* a);
  72. void freelist(Tmovelist* movelist);
  73. unsigned long getmovecount(Tmovelist* movelist);
  74. int getboardscore(Tcurrent *a);