bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnubg] Tutor mode patches for double/redouble


From: Jim Segrave
Subject: [Bug-gnubg] Tutor mode patches for double/redouble
Date: Sun, 28 Jul 2002 12:24:08 +0200
User-agent: Mutt/1.2.5i

Someone in rec.games.backgammon pointed out that tutor mode didn't
warn about bad doubles. I seem to have overlooked double/redouble. 
Here are patches against Saturday's CVS

==================================================

--- play.c      Sat Jul 27 21:15:08 2002
+++ play.c.orig Thu Jul 25 21:08:44 2002
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: play.c patches by jes $
+ * $Id: play.c,v 1.139 2002/07/25 19:08:44 thyssen Exp $
  */
 
 #include "config.h"
@@ -1969,65 +1969,6 @@
     TurnDone();
 }
 
-static skilltype GoodDouble (int fisRedouble) {
-
-    float arDouble[ 4 ], aarOutput[ 2 ][ NUM_ROLLOUT_OUTPUTS ];
-    cubeinfo ci;
-       cubedecision cd;
-    float rDeltaEquity;
-       int      fAnalyseCubeSave = fAnalyseCube;
-
-       /* reasons that doubling is not an issue */
-    if( (ms.gs != GAME_PLAYING) || 
-               ms.anDice[ 0 ]         || 
-               (ms.fDoubled && !fisRedouble) || 
-               (!ms.fDoubled && fisRedouble) ||
-               ms.fResigned ||
-               (ap[ ms.fTurn ].pt != PLAYER_HUMAN )) {
-
-      return (SKILL_NONE);
-    }
-
-       GetMatchStateCubeInfo( &ci, &ms );
-
-       fAnalyseCube = TRUE;
-       if( !GetDPEq ( NULL, NULL, &ci ) ) {
-         fAnalyseCube = fAnalyseCubeSave;
-         return (SKILL_NONE);
-       }
-
-       /* Give hint on cube action */
-
-       ProgressStart( _("Considering cube action...") );
-       if ( GeneralCubeDecisionE ( aarOutput, ms.anBoard, &ci, 
-                                                               &esEvalCube.ec 
) < 0 ) {
-         ProgressEnd();
-         fAnalyseCube = fAnalyseCubeSave;
-         return (SKILL_NONE);;
-       }
-       ProgressEnd();
-           
-       cd = FindCubeDecision ( arDouble, aarOutput, &ci );  
-
-       switch ( cd ) {
-       case NODOUBLE_TAKE:
-       case NODOUBLE_BEAVER:
-       case TOOGOOD_TAKE:
-       case TOOGOOD_PASS:
-       case NO_REDOUBLE_TAKE:
-       case NO_REDOUBLE_BEAVER:
-       case TOOGOODRE_TAKE:
-
-         rDeltaEquity = arDouble [OUTPUT_TAKE] - arDouble [OUTPUT_NODOUBLE];
-         break;
-  
-       default:
-         return (SKILL_NONE);
-       }
-
-       return Skill (rDeltaEquity);
-}
-
 extern void CommandDouble( char *sz ) {
 
     moverecord *pmr;
@@ -2091,9 +2032,6 @@
        return;
     }
     
-  if ( fTutor && !GiveAdvice( GoodDouble( FALSE ) ))
-         return;
-
     if( fDisplay )
        outputf( _("%s doubles.\n"), ap[ ms.fTurn ].szName );
 
@@ -3004,9 +2942,6 @@
        return;
     }
     
-       if ( fTutor && !GiveAdvice( GoodDouble( TRUE ) ))
-         return;
-
     if( fDisplay )
        outputf( _("%s accepts and immediately redoubles to %d.\n"),
                ap[ ms.fTurn ].szName, ms.nCube << 2 );

==================================================

-- 
Jim Segrave           address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]