home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Libraries / Connect-4 Algorithm / c4.info < prev    next >
Encoding:
Text File  |  1994-11-09  |  3.6 KB  |  77 lines  |  [TEXT/R*ch]

  1. /****************************************************************************/
  2. /****************************************************************************/
  3. /**                                                                        **/
  4. /**                          Connect-4 Algorithm                           **/
  5. /**                                                                        **/
  6. /**                            By Keith Pomakis                            **/
  7. /**                     (kppomaki@jeeves.uwaterloo.ca)                     **/
  8. /**                                                                        **/
  9. /**                               Fall, 1993                               **/
  10. /**                                                                        **/
  11. /****************************************************************************/
  12. /****************************************************************************/
  13.  
  14. The files "c4.c" and "c4.h" provide the functions necessary to implement a
  15. front-end-independent, device-independent Connect-4 game.  Multiple board
  16. sizes are supported.  It is also possible to specify the number of pieces
  17. necessary to connect in a row in order to win.  Therefore one can play
  18. Connect-3, Connect-5, etc.  An efficient tree-searching algorithm (making
  19. use of alpha-beta cutoff decisions) has been implemented to insure that the
  20. computer plays as quickly as possible.
  21.  
  22. The file "game.c" is also being distributed, which illustrates how the
  23. Connect-4 functions can be used to construct an implementation of an actual
  24. game.  This file was quickly written just to get an actual implementation up
  25. and running; it is NOT the reason for this distribution.  The idea is for
  26. people to create their own front-ends for this algorithm.  The functions
  27. have been designed to be general enough to be used with any front-end one
  28. wishes to design.
  29.  
  30. The documentation describing each function can be found in the source code
  31. itself, "c4.c".  I believe the comments in this file are clear and
  32. explanatory enough not to warrant an external documentation file.  The
  33. sample front-end, "game.c", contains no documentation (hey, I've got other
  34. work to do, you know!).
  35.  
  36.  
  37. History
  38. -------
  39.  
  40. I developed this particular algorithm back in October 1992 for an
  41. Artificial Intelligence assignment.  At the time, I implemented it in LISP.
  42. One year later I decided to convert the algorithm to C code so that I could
  43. use it as the smarts of a graphical front-end to the game.  In performing
  44. the conversion, I took care to make the code as general as possible.
  45.  
  46. The graphical front-end that I developed is not being distributed, partly
  47. because it's a heck of a lot of code, and partly because I doubt many people
  48. would have access to the SGI hardware necessary to run it.
  49.  
  50.  
  51. The Algorithm Itself
  52. --------------------
  53.  
  54. I've never actually WRITTEN the algorithm down anywhere, apart from the
  55. actual source code itself.  Nevertheless, it's a pretty nifty algorithm that
  56. I'd be happy to explain to anybody who's interested.
  57.  
  58.  
  59. Legal Stuff, etc.
  60. -----------------
  61.  
  62. I am releasing these functions to the public domain.  Therefore, people can
  63. use them, copy them, distribute them, modify them, and do whatever they
  64. want with them.
  65.  
  66. If you find any bugs (gasp!) or have any questions or comments about the
  67. functions or about the algorithm itself, you can contact me via e-mail.  My
  68. address is "kppomaki@jeeves.uwaterloo.ca".  I'd be interested in hearing
  69. what you think!
  70.  
  71. Oh, one other thing... I've put a lot of work into these functions, so I'd
  72. appreciate it if you kept my name attached to them when distributing or
  73. modifying them.  If you actually use these functions for anything, give me
  74. credit somewhere!
  75.  
  76.  
  77.