home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / pcgamn6.zip / BACKGMMN.DOC < prev    next >
Text File  |  1986-09-08  |  13KB  |  298 lines

  1. /*
  2. **  backgmmn.doc - history file
  3.  
  4.    Program  : PC-Gammon IV with User-Defined ** COLOR **
  5.    Computer : 100% IBM PC compatibles 
  6.    Language : Microsoft C 4.00
  7.             :
  8.    Author   : David C. Oshel
  9.             : 1219 Harding Avenue
  10.             : Ames, Iowa 50010
  11.             : August 10, 1986
  12.  
  13.  
  14. HISTORY
  15. -------
  16. v6.0 9/08/86 - Now linking to CIAO.LIB, with fast video RAM output
  17.  
  18. v5.3 9/01/86 - Minor change, just added typeafile for the user's manual.
  19.                Typeafile is a new addition to the IO.LIB.
  20.  
  21. v5.2 8/21/86 - Got rid of clairol.obj, in favor of an improved io.lib.
  22.                Includes ambiguity test in clairol(), adds a mode
  23.                argument to the vid_init() routine, adds a vid_exit()
  24.                routine.  The library is smaller, and allows a smaller
  25.                obj file where only sound or keyin is needed.  The clairol()
  26.                function now does a wputs("^0"); on exit to ensure the new 
  27.                normal mode is set.
  28.  
  29.                PC-Gammon now allows a command line parameter.  
  30.                Sets video mode 2 instead of video mode 3, if present.  
  31.                Usage: backgmmn b&w
  32.  
  33.                Actually, any argument will do, but document "b&w" for users.
  34.  
  35.  
  36.  
  37. v5.1 8/18/86 - minor add: "^0" to mycount(), yrcount() format strings
  38.                minor edits in backgmmn.h to remove obsolete function decls
  39.  
  40.                Note that wprintf("^%d", cnt); is DANGEROUS, depending on
  41.                how the cnt argument gets formatted.  The correct usage in
  42.                this case is wprintf("^0%d", cnt);, with the zero!  This
  43.                ensure that the ^ escape finds a legitimate command char in
  44.                the anticipated position.
  45.  
  46.                Note that the current main() and command() fns in bg0.c were
  47.                split apart in version 5.0:  vid_init() was in the wrong
  48.                place to correctly save the startup screen for cga!  The
  49.                public domain version is ok, has the change.  Note also that
  50.                setting video mode 3 absolutely will clear the cga startup
  51.                screen and send cursor home, so there's no point saving it,
  52.                but we do it anyway.  It's a good screen to come home to.
  53.  
  54.                TO DO: ruminate on improvements in playing strategy.  Torve
  55.                seems unexpectedly strong, lately.  Have I overlooked some
  56.                strength not noted there before?  Need to pin that last bug
  57.                in the Arrange command, if I can figure out what it is!  Is
  58.                Torve reacting to full moon?  Are small but noticeable changes 
  59.                in strategy the result of using a $600 compiler for a change?
  60.                Have I finally gone mad?
  61.  
  62.  
  63. Version 5.0  August 17, 1986, the LAST public domain version of PC-Gammon!
  64.  
  65.    a) Reorganized the code into four sensible modules, with a
  66.       common header file, for use with MAKE.  The source files are
  67.       backgmmn.h, bg0.c, bg1.c, bg2.c, bg3.c.  Supporting modules
  68.       are clairol.obj, and its .h file.
  69.  
  70.    b) Revised code to use the new wprintf() function. (<stdarg.h> in
  71.       Microsoft C 4.0 is magic!)
  72.  
  73.       Simplified the savescreen(), restorescreen() calls to do automatic
  74.       heap allocation/free.
  75.  
  76.    c) Added the CLAIROL module to change screen attributes.
  77.       (Combined module from CURSES.C, SOUND.C., plus clairol() routine.)
  78.  
  79.    d) In other words, PC-Gammon now has full color support for the cga 
  80.       and color monitor.  WITHOUT sacrificing special support for the
  81.       monochrome adapter.
  82.  
  83.  
  84.  
  85. Version 4.4  August 12, 1986
  86.  
  87.    a) Revised BGTOKENS.C to default to my preferred stones.
  88.    b) Added H(ues stub to main command line, if not monochrome.
  89.  
  90. Version 4.3  August 10, 1986
  91.  
  92.    a) Minor changes to CURSES.OBJ file.  Variables for screen
  93.       attributes can support color selection in a H(ues command.
  94.       Appended the old GETMS file to CURSES.  Some changes in
  95.       argument order for windowing commands (in the direction
  96.       of easier to remember and more consistent).
  97.  
  98. Version 4.2  August 3, 1986
  99.  
  100.    a) V.4.1 FAILED its test on the cga card!  Modified CURSES.OBJ to
  101.       correctly set 80x25 text 16/8 mode on PCs with cga cards.  Moved
  102.       call to title() into setup(), so the change is noted before
  103.       anything is output to screen.  Tested results on NCR PC Model 3
  104.       with cga, and on Epson Equity I.  Passed with flying colors (for
  105.       B&W, that is)!
  106.  
  107. Version 4.1  August 2, 1986
  108.  
  109.    a) Minor revision to CURSES.OBJ allows wink() to handle '\b'.
  110.       Discovered that Microsoft C 3.00 interprets '\008' as '\0', 
  111.       not '\b', so changed the backgammon source code accordingly.
  112.  
  113. Version 4.0  August 2, 1986 (PC clone version Gammon IV.40)
  114.  
  115.    a) Added sound and ultra-fast screen io.  Makes it a game for 100% 
  116.       clones only, now.  Totally ignores ANSI.SYS, if present.
  117.  
  118.    b) Altered keyin() and getms() to accept function parameters for
  119.       the wait-for-input and the do-on-ESC routines.  For separate 
  120.       compilation later (maybe).
  121.  
  122.    c) Revised references to '\n' in user input routines because
  123.       keyin() does not return newline when it encounters ENTER. 
  124.       In effect, the "All ok?" question now accepts ENTER and does
  125.       not force users to type 'Y'.  
  126.  
  127.    d) Fixed a bug in user's dice routine.  
  128.  
  129.    e) Known BUG:  Computer does not come in from the bar on the first 
  130.       roll after Arrange-ing the board.
  131.       
  132.  
  133.  
  134. Version 3.1:  July 29, 1986 (MS-DOS version Gammon IV.31)
  135.  
  136.    a) Changed the keyin() routine to correctly handle Fn key inputs.
  137.       Extended ASCII is returned with high bit set from now on.
  138.  
  139.  
  140.  
  141. Version 3:   July 27, 1986 (Original MS-DOS version Gammon IV.30)
  142.  
  143.    a) Numerous minor changes to the code reflect differences in
  144.       C compilers and their standard libraries.   In particular,
  145.       Microsoft C implements some functions as macros -- locating all
  146.       the side effects of this approach can be troublesome when
  147.       porting.
  148.  
  149.       Otherwise, this is just a "quick and dirty" port; old code which
  150.       implemented for the Lear-Siegler ADM-3A terminal's lack of a
  151.       clear-to-end-of-line command has not been optimized (or cleaned
  152.       up, depending on your point of view).
  153.  
  154.    b) The graphics toggle (CP/M Kaypro) is a hilite toggle (MS-DOS ANSI). 
  155.  
  156.    c) User bailout is ESC.  Control-C is trapped by MS-DOS and halts
  157.       the program.
  158.  
  159.    d) The "kill typeahead" feature (in BG0.C) is commented out to improve
  160.       play under the abominably slow conditions of IBM-clone i/o.
  161.  
  162.  
  163.  
  164. Version 2:   March 28, 1986 (CP/M)
  165.  
  166.    a) Fixed the bug in which the doubling cube might revert to its
  167.       default value if the computer took back a move, and if the cube
  168.       had been doubled one or more times during the opening roll-off
  169.       but not yet offered.
  170.  
  171.    b) Fixed an odd bug in the Arrange command which occasionally caused 
  172.       stones to switch allegiance to the opponent's color, or else to
  173.       mysteriously multiply to more than 15 on a side.
  174.  
  175.    c) An improved error handler now hints that BAR and HOME are words
  176.       used in the game; also, slows down the incorrect entry routine so
  177.       that it is less mysterious than before.  
  178.  
  179.    d) Added a Graphic toggle to main command line.  Same as Control-K,
  180.       as in previous versions; turns on/off the Kaypro '84 video graphics;
  181.       uses the alternate token set defined in the CRT module below.
  182.  
  183.    e) Changed the break character back to Control-C; there is a
  184.       proximity problem in keyboarding the escape key on a Kaypro
  185.       keyboard.  (Various CP/M versions may have used either ESC or 
  186.       Control-C, depending.)
  187.  
  188.    f) There is no longer a sanction against cheating; if you bail
  189.       out during play and re-Arrange the stones, your opponent
  190.       does not change.
  191.  
  192.    g) As before, the computer will not always take (or find) a forced 
  193.       move.  The rule is that the player must take both dice if possible,
  194.       or the larger if both are possible singly but not together.
  195.       The playing algorithm attempts to find the legally required move, 
  196.       but will sometimes fail.  It is sometimes advantageous to avoid a
  197.       forced move but the computer cannot make that distinction in this
  198.       version; the program allows the same lenience for the human player.
  199.  
  200.       The cube is doubled when doubles are thrown during the opening
  201.       rolloff to decide who goes first.  However, if the cube reaches 8,
  202.       further pairs on the dice during rolloff have no effect.
  203.  
  204.       Gammon IV knows all the other OFFICIAL rules of the game; 
  205.       U.S. Navy and/or Saloon rules don't count.
  206.  
  207.    h) Improved coding in some routines, especially putstone(), which was
  208.       far more baroque than necessary.  There is also some occasional 
  209.       re-coding, where I could not prevent myself.  The game strategy
  210.       has not been changed, mostly because I don't fully understand it
  211.       anymore, even though the documentation there is better than usual.
  212.       It was written months ago in a white heat of inspiration; but I
  213.       feel reluctant to submit myself to that strain again, without the
  214.       prospect of remuneration.
  215.  
  216.  
  217. INTRODUCTION
  218. ------------
  219.  
  220. Gammon IV is a full-screen backgammon game.  I wrote it for CP/M 
  221. some time ago, and have finally gotten around to porting it to MS-DOS.
  222.  
  223. Gammon IV has always been designed to run nicely on the lowest common
  224. denominator of available computer terminals.  The CP/M version has a
  225. number of sophisticated i/o features which are nevertheless compatible 
  226. with the Lear-Siegler ADM-3A (extremely) dumb terminal.
  227.  
  228. This version assumes 100% IBM-compatible io, for screen and sound.
  229. Screen control is via ROM BIOS calls, sound control uses port io.
  230.  
  231.  
  232.  
  233.  
  234. DISCUSSION ABOUT THE PORT FROM CP/M TO MS-DOS (Gammon IV.30)
  235. ------------------------------------------------------------
  236. This is a straightforward "port" from CP/M to MS-DOS.  GAMMON IV was
  237. originally written for the Kaypro 10.  It has now been translated for
  238. the Epson Equity I, or any IBM-PC clone with an ANSI terminal (below).
  239.  
  240. The original language was Toolworks C/80, version 3.1 (CP/M), the 
  241. current language is Microsoft C, version 3.00 (MS-DOS).
  242.  
  243. Program modules have been altered to account for the PC-clone
  244. environment.  
  245.  
  246. In addition, certain in-line assembly kludges which were required in 
  247. the CP/M version have now been replaced by pure C code in the MS-DOS 
  248. version; i.e., there are some minor changes involving setjmp() and 
  249. longjmp(), which now control program logic in a more portable fashion.  
  250.  
  251.  
  252.  
  253.  
  254. DISCUSSION OF THE PROGRAM
  255. _________________________
  256.  
  257. Gammon IV is probably the best FREE backgammon game ever written....
  258. I'm not modest!  I wrote it because I was disgusted with the price 
  259. and dullness of all other public domain programs which allegedly play 
  260. backgammon. 
  261.  
  262. This program has THREE DIFFERENT PLAYING STYLES, any one of which can
  263. consistently beat a novice player, and occasionally beat a good player.
  264. In all three levels, the computer's strategy can even seem brilliant;
  265. there is nothing routine about it.
  266.  
  267. This version incorporates a few minor changes and bug fixes which make it
  268. different from previous editions which have appeared on various bulletin 
  269. boards and club offerings around the country.  This is a public domain
  270. program.  Feel free to distribute or improve it.  Credit to the original
  271. author (me) will be appreciated, but is not strictly required since the
  272. copyright owners are abnormally mild-mannered (and extremely distant;
  273. see Acknowledgments, below.)
  274.  
  275. Acknowledgments:
  276.  
  277.    The opening dialogue, in which you chose your computer opponent,
  278.    is freely adapted from Alexei Panshin's long out-of-print, and
  279.    now classic, "Star Well" travelogues.  Scholars of computer history 
  280.    will recognize many allusions to this same opus in various passages 
  281.    of Mike Goetz's 550-point Adventure (especially in the Ice Caverns!).  
  282.  
  283.    The Xochitl Sodality, which owns the copyright on Gammon IV, is a 
  284.    philanthropic society first publicized by Panshin.  Persons who wish 
  285.    to obtain information on site licensing for Gammon IV should contact 
  286.    the Monist Association imaginary properties secretary at the following 
  287.    address:
  288.                       Monist Association I.P.S.
  289.                       c/o Xochitl Sodality
  290.                       Semichastny House
  291.                       Delbalso, Nashuite Empire
  292.  
  293.  
  294. */
  295.  
  296. /* eof: backgmmn.doc */
  297.  
  298.