home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / mapi / checkers.frm / engine.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-11  |  1.9 KB  |  80 lines

  1. /* --------------------------------------------------------------------------
  2.  
  3. Basic Forms example of a custom sendable form.  It is an EXE server
  4. rather than a DLL.  It implements the minimum form interface required
  5. to launch and send a form.
  6.  
  7. Copyright (C) 1995 Microsoft Corporation
  8.  
  9. -------------------------------------------------------------------------- */
  10.  
  11. /* facilitate compilation accross modules without losing any optimizations
  12.    of the engine */
  13.  
  14. #define WINDOWS
  15.  
  16. #include <windows.h>  // user interface stuff follows
  17. #include <windowsx.h>
  18. #include <stdio.h>
  19. #include <stdlib.h>
  20. #include <string.h>
  21. #include <process.h>
  22. #include <malloc.h>
  23. #include <memory.h>
  24. #include <conio.h>
  25. #include <time.h>
  26. #include <ctype.h>
  27. #include <search.h>
  28. #include <stdarg.h>
  29.  
  30. #ifdef _WIN32
  31. #include <winver.h>
  32. #else
  33. #include <ver.h>
  34. #endif
  35.  
  36. extern struct   rCheckConfigRec rConfig;
  37. extern class    CMoveList CMoves;
  38. extern struct   rGameStateRec rGameState;
  39.  
  40.  
  41. extern unsigned int _charmax;
  42.  
  43.  
  44. //---[ Local header user interface dependencies ]-----------------------------------------
  45.  
  46. #include "check.h"
  47. #include "dlg.h"
  48. #include "wcheck.h"
  49. #include "checkdta.h"
  50. #include "movelist.h"
  51. #define DEBUG_CODE
  52. #include "dbugit.h"
  53.  
  54. /* user interface externals */
  55. #ifdef DEBUG
  56. ASSERTDATA
  57. #endif
  58.  
  59. /* --------------------------------------------------------------------------
  60. Global variables
  61. -------------------------------------------------------------------------- */
  62.  
  63. int debug=0;              /* these variables should not be used outside the
  64.                              scope of the checkers engine */
  65.  
  66. int computer_color = BLACK;
  67. int depth_maximum = 5;
  68.  
  69.  
  70. #ifndef DEBUG
  71. #pragma optimize("agtw",on)
  72. #endif
  73.  
  74. #include ".\engine\lut.cpp"
  75. #include ".\engine\debugio.cpp"
  76. #include ".\engine\quality.cpp"
  77. #include ".\engine\check.cpp"
  78. #include ".\engine\prune.cpp"
  79. #include ".\engine\valid.cpp"
  80.