From 688fd64b520cf033f64fa9f0128af3aff4b8f72b Mon Sep 17 00:00:00 2001 From: joey Date: Thu, 25 May 2006 00:40:28 +0000 Subject: [PATCH] * Patch from Alan Curry to backgammon to fix a bug that caused the computer player to skip a turn near the end of the game. Closes: #368771 * Also some tutorial grammar fixes. * Patch from Alan Curry to backgammon to make movallow() try again with dice swapped when it finds that there is no possible move with the second die after the first die was used to move a man off the bar. Closes: #185100 git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@12456 a4a2c43b-8ac3-0310-8836-e0e880c912e2 --- backgammon/backgammon/move.c | 3 +++ backgammon/common_source/allow.c | 4 +++- backgammon/teachgammon/ttext1.c | 2 +- backgammon/teachgammon/ttext2.c | 2 +- debian/changelog | 11 +++++++++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/backgammon/backgammon/move.c b/backgammon/backgammon/move.c index 9fd81f1..027cab5 100644 --- a/backgammon/backgammon/move.c +++ b/backgammon/backgammon/move.c @@ -152,6 +152,9 @@ move(okay) trymove(0, 0); pickmove(); + if (d0) + swap; + /* print move */ writel(" and moves "); for (i = 0; i < mvlim; i++) { diff --git a/backgammon/common_source/allow.c b/backgammon/common_source/allow.c index f6bae78..8189f07 100644 --- a/backgammon/common_source/allow.c +++ b/backgammon/common_source/allow.c @@ -83,8 +83,10 @@ movallow() p[i--] = bar; if (p[i] != bar) continue; - else + else if (d0) break; + swap; + continue; } if (d0 || m == 4) break; diff --git a/backgammon/teachgammon/ttext1.c b/backgammon/teachgammon/ttext1.c index 82db223..73ea6ee 100644 --- a/backgammon/teachgammon/ttext1.c +++ b/backgammon/teachgammon/ttext1.c @@ -94,7 +94,7 @@ const char *const intro2[] = { "\n Although not indicated on the board, the players' homes are", "located just to the right of the board. A player's men are placed", "there when they are removed from the board. The board you just", - "saw was in it's initial position. All games start with the board", + "saw was in its initial position. All games start with the board", "looking like this. Notice that red's pieces are represented by the", "letter 'r' and white's pieces are represented by the letter 'w'.", "Also, a position may have zero or more pieces on it, e.g. posi-", diff --git a/backgammon/teachgammon/ttext2.c b/backgammon/teachgammon/ttext2.c index 5e827d7..eb9a083 100644 --- a/backgammon/teachgammon/ttext2.c +++ b/backgammon/teachgammon/ttext2.c @@ -65,7 +65,7 @@ const char *const stragy[] = { "points in a row) are difficult to form, many points nestled close-", "ly together produce a formidable barrier. Also, while it is good", "to move back men forward, doing so lessens the opportunity for you", - "to hit men. Finally, remember that once the two player's have", + "to hit men. Finally, remember that once the two players have", "passed each other on the board, there is no chance of either team", "being hit, so the game reduces to a race off the board. Addi-", "tional hints on strategy are presented in the practice game.", diff --git a/debian/changelog b/debian/changelog index ec9f208..1376e65 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +bsdgames (2.17-8) unstable; urgency=low + + * Patch from Alan Curry to backgammon to fix a bug that caused the computer + player to skip a turn near the end of the game. Closes: #368771 + * Also some tutorial grammar fixes. + * Patch from Alan Curry to backgammon to make movallow() try again with dice + swapped when it finds that there is no possible move with the second die + after the first die was used to move a man off the bar. Closes: #185100 + + -- Joey Hess Wed, 24 May 2006 20:23:25 -0400 + bsdgames (2.17-7) unstable; urgency=medium * sail: Fix a scanf buffer overrun in initial broadside prompt code,