home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / tbridge.zip / SCORE.BR < prev   
Text File  |  1986-06-01  |  19KB  |  668 lines

  1. { ╔══════════════════════════════════════════════════════╗
  2.   ║          SCORE.BR  Module of BRIDGE.PAS              ║                                                      ║
  3.   ║                                                      ║
  4.   ║                Last modified 10/29/85                ║
  5.   ║                                                      ║
  6.   ║    Calculates, displays and outputs bridge score.    ║
  7.   ║                                                      ║
  8.   ╚══════════════════════════════════════════════════════╝
  9. }
  10. type
  11.   GameRecordType = array[1..3] of integer;
  12.  
  13.   ScoreType = record
  14.                 GamesWon,
  15.                 OverLine,
  16.                 Total      : integer;
  17.                 GameRecord :  GameRecordType;
  18.               end;
  19.   GameTableType = record
  20.                     CurGame : integer;
  21.                     N_S,
  22.                     E_W     : ScoreType;
  23.                   end;
  24. var
  25.   Games : GameTableType;
  26.  
  27. procedure InitScore;
  28. { Initializes the scoring record }
  29. begin
  30.   FillChar(Games, SizeOf(Games), chr(0));
  31. end; { InitScore }
  32.  
  33. procedure DisplayScore(RubberBonus : integer);
  34. const
  35.   FirstCol      = 60;
  36.   FirstRow      = 11;
  37.   LastCol       = 79;
  38.   LastRow       = 22;
  39.   BorderTop     =  1;
  40.   BorderBottom  = 12;
  41.   BorderLeft    =  1;
  42.   BorderRight   = 20;
  43.  
  44. procedure ClearBoard;
  45. { Clears the score board }
  46. begin
  47.   Window(FirstCol + 1, FirstRow + 1, LastCol - 1, LastRow - 1);
  48.   ClrScr;
  49.   Window(FirstCol, FirstRow, LastCol, LastRow + 1);
  50. end; { ClearBoard }
  51.  
  52. procedure DrawBorder;
  53. { Draw a border around the score board }
  54. var
  55.   Row, Col : integer;
  56. begin
  57.   SetColor(BorderColor);
  58.   GotoXY(BorderLeft, BorderTop);
  59.   Write('╔');
  60.   for Col := BorderLeft + 1 to BorderRight - 1 do
  61.   begin
  62.     if Col = (BorderLeft + (BorderLeft + BorderRight) div 2) then
  63.       Write('╤')
  64.     else
  65.       Write('═');
  66.   end;
  67.   Write('╗');
  68.   for Row := BorderTop + 1 to BorderBottom - 1 do
  69.   begin
  70.     GotoXY(BorderLeft, Row);
  71.     Write('║');
  72.     GotoXY(BorderRight, Row);
  73.     Write('║');
  74.   end;
  75.   GotoXY(BorderLeft, BorderBottom);
  76.   Write('╚');
  77.   for Col := BorderLeft + 1 to BorderRight - 1 do
  78.     if Col = (BorderLeft + (BorderLeft + BorderRight) div 2) then
  79.       Write('╧')
  80.     else
  81.       Write('═');
  82.   Write('╝');
  83.   GotoXY(4,BorderTop);
  84.   Write('[');
  85.   SetColor(ScoreColor);
  86.   Write('BRIDGE');
  87.   GotoXY(12, BorderTop);
  88.   Write('SCORE');
  89.   SetColor(BorderColor);
  90.   Write(']');
  91.   SetColor(ScoreBrdColor);
  92. end; { DrawBorder }
  93.  
  94. procedure DrawLine(CurY : integer);
  95. { Draws a single Line }
  96. var
  97.   CurX : integer;
  98. begin
  99.   SetColor(BorderColor);
  100.   GotoXY(BorderLeft, BorderTop + CurY);
  101.   Write('╟');
  102.   SetColor(ScoreBrdColor);
  103.   for CurX := (BorderLeft + 1) to (BorderRight - 1) do
  104.     begin
  105.       GotoXY(CurX, BorderTop + CurY);
  106.       if CurX = (BorderLeft + (BorderLeft + BorderRight) div 2) then
  107.         Write('┼')
  108.     else
  109.       Write('─');
  110.     end;
  111.   GotoXY(BorderRight, BorderTop + CurY);
  112.   SetColor(BorderColor);
  113.   Write('╢');
  114.   SetColor(ScoreBrdColor);
  115. end; { DrawLine }
  116.  
  117. procedure DisplayTotals(var Games   : GameTableType;
  118.                         RubberBonus : integer);
  119. const
  120.   NorthCol =   4;
  121.   EastCol =   14;
  122.  
  123. procedure DispGame(var Games : GameTableType;
  124.                     ThisGame : integer;
  125.                     var CurY : integer );
  126. begin
  127.   with Games do
  128.   begin
  129.     GotoXY(NorthCol, (BorderTop + CurY));  { The score under the Line }
  130.     with N_S do
  131.     begin
  132.       Write(GameRecord[ThisGame]:4);
  133.       Total := Total + GameRecord[ThisGame];
  134.     end;
  135.     GotoXY(EastCol,BorderTop + CurY);
  136.     with E_W do
  137.     begin
  138.       Write(GameRecord[ThisGame]:4);
  139.       Total := Total + GameRecord[ThisGame];
  140.     end;
  141.     CurY := CurY + 1;
  142.   end; { with }
  143. end; { DispGame }
  144.  
  145. procedure DispTeamScores(var Games : GameTableType);
  146. const
  147.   Start = 4;
  148. var
  149.   i, CurY : integer;
  150. begin
  151.   with Games do
  152.     for i := 1 to CurGame do
  153.     begin
  154.       CurY := Start + (2 * (i -1));
  155.       DispGame(Games, i, CurY);
  156.       if i < CurGame then
  157.         DrawLine(CurY);
  158.     end;
  159. end; { DispTeamScores }
  160.  
  161. procedure DispTeamTotals(var Games : GameTableType);
  162. const
  163.   TotalLine = 1;
  164.   OverLinePos  = 2;
  165. begin
  166.   with Games do
  167.   begin
  168.     GotoXY(NorthCol, BorderTop + OverLinePos);
  169.     Write(N_S.OverLine:4);
  170.     GotoXY(EastCol, BorderTop + OverLinePos);
  171.     Write(E_W.OverLine:4);
  172.     GotoXY(NorthCol,BorderBottom - TotalLine);
  173.     with N_S do
  174.     begin
  175.       Total := Total + OverLine;
  176.       Write(Total:4);
  177.     end;
  178.     GotoXY(EastCol,BorderBottom - TotalLine);
  179.     with E_W do
  180.     begin
  181.       Total := Total + OverLine;
  182.       Write(Total:4);
  183.     end;
  184.   end;
  185. end; { DispTeamTotals }
  186.  
  187. procedure AddBonus(RubberBonus : integer);
  188. begin
  189.   if RubberBonus > 0 then
  190.     with Games do
  191.       case Dummy of
  192.         North, South : N_S.Overline := N_S.Overline + RubberBonus;
  193.         East, West   : E_W.Overline := E_W.Overline + RubberBonus;
  194.       end;
  195. end; { AddBonus }
  196.  
  197. begin  { DisplayTotals }
  198.   with Games do
  199.   begin
  200.     with Games do
  201.     begin
  202.       N_S.Total := 0;
  203.       E_W.Total := 0;
  204.     end;
  205.     if CurGame > 0 then
  206.     begin
  207.       AddBonus(RubberBonus);
  208.       DispTeamScores(Games);
  209.     end;
  210.     DispTeamTotals(Games);
  211.   end;
  212. end; { DisplayTotals }
  213.  
  214. procedure DrawBoard;
  215.  
  216. procedure DrawDblLine;
  217. const
  218.   DblLinePos = 3;
  219. var
  220.   CurX : integer;
  221. begin
  222.   SetColor(BorderColor);
  223.   GotoXY(BorderLeft, BorderTop + DblLinePos);
  224.   Write('╠');
  225.   SetColor(ScoreBrdColor);
  226.   for CurX := (BorderLeft + 1) to (BorderRight - 1) do
  227.   begin
  228.     GotoXY(CurX, BorderTop + DblLinePos);
  229.     if CurX = (BorderLeft + (BorderLeft + BorderRight) div 2) then
  230.       Write('╪')
  231.     else
  232.       Write('═');
  233.   end;
  234.   GotoXY(BorderRight, BorderTop + DblLinePos);
  235.   SetColor(BorderColor);
  236.   Write('╣');
  237.   SetColor(ScoreBrdColor);
  238. end; { DrawDblLine }
  239.  
  240. procedure DrawTotalLine;
  241. const
  242.   TotalLinePos = 2;
  243. var
  244.   CurX : integer;
  245. begin
  246.   SetColor(BorderColor);
  247.   GotoXY(BorderLeft, BorderBottom - TotalLinePos);
  248.   Write('╠');
  249.   SetColor(ScoreBrdColor);
  250.   for CurX := (BorderLeft + 1) to (BorderRight - 1) do
  251.   begin
  252.     GotoXY(CurX, BorderBottom - TotalLinePos);
  253.     if CurX = (BorderLeft + (BorderLeft + BorderRight) div 2) then
  254.       Write('╪')
  255.     else
  256.       Write('═');
  257.   end;
  258.   GotoXY(BorderRight, BorderBottom - TotalLinePos);
  259.   SetColor(BorderColor);
  260.   Write('╣');
  261.   SetColor(ScoreBrdColor);
  262. end; { DrawTotalLine }
  263.  
  264. var
  265.   CurX, CurY : integer;
  266.  
  267. begin { DrawBoard }
  268.   GotoXY(BorderLeft + 4, BorderTop + 1);
  269.   Write('N/S       E/W');
  270.   CurX := BorderLeft + (BorderLeft + BorderRight) div 2;
  271.   for CurY := (BorderTop + 1) to (BorderBottom - 1) do
  272.   begin
  273.     GotoXY(CurX,CurY);
  274.     Write('│');
  275.   end;
  276.   DrawDblLine;
  277.   DrawTotalLine;
  278. end; { DrawBoard }
  279.  
  280. procedure RestoreScreen;
  281. begin
  282.   ClrScr;
  283.   Window(FirstCol, FirstRow, LastCol, LastRow + 1);
  284.   ClrScr;
  285.   Window(1, 1, 80, 25);
  286.   ClearMenu;
  287.   GotoXY(1, 1);
  288. end; { RestoreScreen }
  289.  
  290. procedure CompareTotals(RubberBonus : integer);
  291. { Checks to see if the team that won the rubber game also won the rubber }
  292. begin
  293.   with Games do
  294.   begin
  295.     case Dummy of
  296.       North, South : begin
  297.                        N_S.Total := N_S.Total + RubberBonus;
  298.                        if E_W.Total > N_S.Total then Write('     E/W ')
  299.                        else Write('     N/S ');
  300.                      end;
  301.       East, West  :  begin
  302.                        E_W.Total := E_W.Total + RubberBonus;
  303.                        if N_S.Total > E_W.Total then Write('     N/S ')
  304.                        else Write('     E/W ');
  305.                      end;
  306.     end;
  307.     Write('won the rubber     ');
  308.   end;
  309. end; { CompareTotals }
  310.  
  311. begin { DisplayScore }
  312.   SetColor(NormalColor);
  313.   ClearMenu;
  314.   Window(FirstCol, FirstRow, LastCol, LastRow + 1);
  315.   DrawBorder;
  316.   SetColor(ScoreBrdColor);
  317.   ClearBoard;
  318.   DrawBoard;
  319.   DisplayTotals(Games, RubberBonus);
  320.   FlushBuffer;
  321.   Window(FirstCol - 12, 21, LastCol, 25);
  322.   GotoXY(4,1);
  323.   SetColor(NormalColor);
  324.   Write('Totals');
  325.   if (RubberBonus > 0) then
  326.   begin
  327.     SetColor(MessageColor);
  328.     if RubberBonus > 1 then
  329.     begin
  330.       GotoXY(5, 3);
  331.       Write(' ');
  332.       PrintTeam(Dummy);
  333.       Write(' won game ',Games.CurGame:1, ' and ');
  334.       Write(RubberBonus:1,' Pts ');
  335.       GotoXY(5, 4);
  336.       CompareTotals(RubberBonus);
  337.     end
  338.     else
  339.     begin
  340.       GotoXY(5, 4);
  341.       Write(' ');
  342.       PrintTeam(Dummy);
  343.       Write(' team won current game ');
  344.     end;
  345.   end;
  346.   GotoXY(6, 5);
  347.   FlushBuffer;
  348.   SetColor(NormalColor);
  349.   Write('Hit any key to continue');
  350.   ReadOne;
  351.   RestoreScreen;
  352. end; { DisplayScore }
  353.  
  354. procedure OutputScore(RubberBonus : integer);
  355.  
  356. procedure OutputTotals(var Games : GameTableType);
  357.  
  358. procedure OutputGame(var Games : GameTableType;
  359.                          ThisGame : integer);
  360. { Prints the underline total for the passed in game to the output file
  361.   and updates the overall total for each team }
  362. begin
  363.   with Games do
  364.   begin
  365.     with N_S do
  366.     begin
  367.       Write(OutputFile, ' ':24, GameRecord[ThisGame]:4);
  368.       Total := Total + GameRecord[ThisGame];
  369.     end;
  370.     Write(OutputFile, '  |  ');
  371.     with E_W do
  372.     begin
  373.       Writeln(OutputFile, GameRecord[ThisGame]:4);
  374.       Total := Total + GameRecord[ThisGame];
  375.     end;
  376.   end; { with }
  377. end; { OutputGame }
  378.  
  379. procedure OutputTeamScores(var Games : GameTableType);
  380. var
  381.   i : integer;
  382. begin
  383.   with Games do
  384.     for i := 1 to CurGame do
  385.     begin
  386.       OutputGame(Games, i);
  387.       if i < CurGame then
  388.         Writeln(OutputFile, ' ':24 , '--------------');
  389.     end;
  390. end; { OutputTeamScores }
  391.  
  392. procedure OutputOverLine(var Games : GameTableType);
  393. begin
  394.   with Games do
  395.   begin
  396.     Write(OutputFile,' ':24 , N_S.OverLine:4);
  397.     Write(OutputFile, '  |  ');
  398.     Writeln(OutputFile, E_W.OverLine:4);
  399.     Writeln(OutputFile, ' ':24 , '==============');
  400.   end;
  401. end; { OutputOverLine }
  402.  
  403. procedure OutputTeamTotals(var Games : GameTableType);
  404. begin
  405.   with Games do
  406.   begin
  407.     Writeln(OutputFile, ' ':24 , '==============');
  408.     Write(OutputFile, ' ':15 , 'Totals:  ');
  409.     with N_S do
  410.       Write(OutputFile, Total + OverLine:4 , '  |  ');
  411.     with E_W do
  412.       Write(OutputFile, Total + OverLine:4);
  413.   end;
  414. end; { OutputTeamTotals }
  415.  
  416. begin  { OutputTotals }
  417.   OutputOverLine(Games);
  418.   OutputTeamScores(Games);
  419.   OutputTeamTotals(Games);
  420. end; { OutputTotals }
  421.  
  422. begin  { OutputScore }
  423.   Writeln(OutputFile);
  424.   Writeln(OutputFile,' ':23 , 'BRIDGE    SCORE');
  425.   Writeln(OutputFile,' ':22 , '=================');
  426.   Writeln(OutputFile,' ':25 , 'N/S  |   E/W');
  427.   OutputTotals(Games);
  428.   Writeln(OutputFile);
  429.   Writeln(OutputFile);
  430.   if (RubberBonus > 0) then
  431.   begin
  432.     Write(OutputFile,' ':10);
  433.     OutputTeam(Dummy);
  434.     if RubberBonus > 1 then
  435.     begin
  436.       Write(OutputFile,' team won rubber game ', Games.CurGame:1);
  437.       Writeln(OutputFile, ' and ',RubberBonus:1,' points');
  438.     end
  439.     else
  440.       Writeln(OutputFile, ' team won current game');
  441.   end;
  442.   Writeln(OutputFile);
  443. end; { OutputScore }
  444.  
  445. procedure CalculateScore;
  446. const
  447.   Game                     =  100; { Points neccesary to win Game        }
  448.   ClubDiamondValue         =   20; { score for Club and Diamond Tricks   }
  449.   HeartSpadeValue          =   30; { score for Heart and Spade Tricks    }
  450.   NoTrumpValueOne          =   40; { score for first No Trump trick      }
  451.   NoTrumpOverOne           =   30; { each No Trump trick after the first }
  452.   NotVulnerableOverTrick   =   50;
  453.   VulnerableOverTrick      =  100;
  454.   MakeDoubledContract      =   50;
  455.   NotVulnerableLittleSlam  =  500;
  456.   VulnerableLittleSlam     =  750;
  457.   NotVulnerableGrandSlam   = 1000;
  458.   VulnerableGrandSlam      = 1500;
  459.   TwoGameRubberBonus       =  700; { Bonus for wining rubber in two Games   }
  460.   ThreeGameRubberBonus     =  500; { bonus for wining rubber in three Games }
  461.  
  462. var                                   { CalculateScore global variables }
  463.   Vulnerable    : boolean;
  464.   Winner, Loser : ScoreType;
  465.   GameWon,
  466.   RubberWon     : boolean;
  467. procedure CalcVulnerabilityPnts(var W : ScoreType);
  468. { this routine determines the bonus points awarded to the user, taking  }
  469. { into consideration the vulnerability of the team.                     }
  470. begin
  471.   with Rel, Contract, W do
  472.   begin
  473.     case Vulnerable of
  474.       true : begin
  475.                if Level = 6 then                           { Small Slam }
  476.                  OverLine := OverLine + VulnerableLittleSlam
  477.                else
  478.                  if Level = 7 then
  479.                    OverLine := OverLine + VulnerableGrandSlam
  480.                else
  481.                  if Doubled > 0 then
  482.                    OverLine := OverLine + MakeDoubledContract +
  483.                    (((WonTricks-(Level+6))*VulnerableOverTrick)*(Doubled*2))
  484.              end;
  485.       false : begin                                         { Small Slam }
  486.                 if Level = 6 then
  487.                    OverLine := OverLine + NotVulnerableLittleSlam
  488.                 else
  489.                   if Level = 7 then                      { Grand Slam }
  490.                      OverLine := OverLine + NotVulnerableGrandSlam
  491.                 else
  492.                   if Doubled > 0 then
  493.                     OverLine := OverLine + MakeDoubledContract +
  494.                     (((WonTricks - (Level+6))*NotVulnerableOverTrick)
  495.                     * (Doubled * 2));
  496.               end;
  497.       end;  { case }
  498.     end;  { with }
  499.   end;  { CalcVulnerabilityPnts }
  500.  
  501. procedure CalcGamePnts(var W : ScoreType;
  502.                        var RubberWon : boolean);
  503. { this routine is called if the team that is playing the Contract wins  }
  504. { enough points to win the current Game.                                }
  505. begin
  506.   with Rel, Contract, W do
  507.   begin
  508.     if GamesWon = 1 then
  509.       RubberWon := false
  510.     else
  511.       RubberWon := true;
  512.   end;   { with }
  513. end; { CalcGamePnts }
  514.  
  515. procedure CalcPenaltyPnts(var W : ScoreType);
  516. { this routine calculates the penalty points awarded to the team that   }
  517. { lost the Bid in the case that the team that won the Bid did not win a }
  518. { sufficient Number of Tricks.                                          }
  519. begin
  520.   with Rel, Contract, W do
  521.     if Winner.GamesWon = 0 then               { not Vulnerable }
  522.       if Doubled = 0 then
  523.         OverLine := OverLine + (50 * (Level + 6 - WonTricks))
  524.       else      { Doubled > 0 }
  525.         OverLine := OverLine + 100 + (200 * ((Level + 6) - WonTricks - 1))
  526.     else  { GamesWon > 0 }
  527.       if Doubled = 0 then
  528.         OverLine := OverLine + (100 * (Level + 6 - WonTricks))
  529.       else      { Doubled > 0 }
  530.         OverLine := OverLine + 200 + (300 * ((Level + 6) - WonTricks - 1));
  531. end; { CalcPenaltyPnts }
  532.  
  533. procedure CaseAssign(var W, L: ScoreType; Init: boolean);
  534. { this routine is called to assign the temporary varables Winner and    }
  535. { Loser their appropriate values from ScoreTable. or to assign Winner   }
  536. { and Loser to their appropriate fields of ScoreTable.                  }
  537. begin
  538.   with Games do
  539.     case Init of
  540.       true : case Dummy of
  541.                North, South : begin
  542.                                 W := N_S;
  543.                                 L := E_W;
  544.                               end;
  545.                East, West   : begin
  546.                                 W := E_W;
  547.                                 L := N_S;
  548.                               end;
  549.              end;  { case }
  550.      false : case Dummy of
  551.                North, South : begin
  552.                                 N_S := W;
  553.                                 E_W := L;
  554.                               end;
  555.                East, West   : begin
  556.                                 E_W := W;
  557.                                 N_S := L;
  558.                               end;
  559.              end;  { end case }
  560.   end;  { end case }
  561. end;  { end CaseAssign }
  562.  
  563. procedure CalculatePoints(var W : ScoreType; CurGame : integer;
  564.                            var GameWon, RubberWon : boolean);
  565. { this routine calculates the points for the current Game and updates   }
  566. { the teams Total scores.                                               }
  567.  
  568. procedure CaseCalc(Value, CurGame : integer);
  569. { this routine is called by the CalculatePoints routine if the Trump  }
  570. { Suit was a Club, Diamond, Heart, or Spade.                          }
  571. begin
  572.   with Rel, Contract, W do
  573.   begin
  574.     if Doubled = 0 then
  575.     begin
  576.       GameRecord[CurGame] := GameRecord[CurGame] + (Level * Value);
  577.       OverLine  := OverLine + ((WonTricks - (Level + 6)) * Value);
  578.     end  { end if then }
  579.     else
  580.       GameRecord[CurGame] := GameRecord[CurGame] +
  581.                              ((Level * Value) * (Doubled * 2));
  582.   end; { with }
  583. end; { CaseCalc }
  584.  
  585. begin { CalculatePoints }
  586.   GameWon := false;
  587.   with Rel, Contract, W do
  588.   begin
  589.     case Trump of
  590.       Club, Diamond : CaseCalc(ClubDiamondValue, CurGame);
  591.       Heart, Spade  : CaseCalc(HeartSpadeValue, CurGame);
  592.       else  { case's else  -   No_Trump }
  593.         if Doubled = 0 then
  594.         begin
  595.           GameRecord[CurGame] := GameRecord[CurGame] + NoTrumpValueOne +
  596.                        ((Level - 1) * NoTrumpOverOne);
  597.           OverLine := OverLine + ((WonTricks - 6 - Level) * NoTrumpOverOne);
  598.         end  { if }
  599.         else
  600.           GameRecord[CurGame] := GameRecord[CurGame] + ((NoTrumpValueOne +
  601.                        ((Level - 1) * NoTrumpOverOne)) * (Doubled * 2));
  602.     end; { case }
  603.     CalcVulnerabilityPnts(W);
  604.     if GameRecord[CurGame] >= Game then                  { Won Game }
  605.     begin
  606.       GameWon := true;
  607.       GamesWon := GamesWon + 1;
  608.       CalcGamePnts(W, RubberWon);
  609.     end;
  610.   end; { with }
  611. end; { CalculatePoints }
  612.  
  613. begin { CalculateScore }
  614.   RubberWon := false;
  615.   GameWon := false;
  616.   with Games do
  617.   begin
  618.     if CurGame = 0 then
  619.       CurGame := 1;
  620.     CaseAssign(Winner, Loser, true);
  621.     with Rel, Contract do
  622.     begin
  623.       if WonTricks >= Level + 6 then
  624.         with Winner do
  625.         begin
  626.           if GamesWon > 0 then
  627.             Vulnerable := true
  628.           else
  629.             Vulnerable := false;
  630.           CalculatePoints(Winner, CurGame, GameWon, RubberWon);
  631.         end { with }
  632.       else
  633.         CalcPenaltyPnts(Loser);    { else WonTricks < Level + 6 }
  634.       CaseAssign(Winner, Loser, false);
  635.     end; { with }
  636.     if RubberWon then
  637.     begin
  638.       if CurGame = 2 then
  639.       begin
  640.         DisplayScore(TwoGameRubberBonus);
  641.         OutputScore(TwoGameRubberBonus);
  642.       end
  643.       else
  644.         if (CurGame = 3) then
  645.         begin
  646.           DisplayScore(ThreeGameRubberBonus);
  647.           OutputScore(ThreeGameRubberBonus);
  648.         end;
  649.       InitScore;
  650.     end
  651.     else
  652.     begin
  653.       if GameWon then
  654.       begin
  655.         DisplayScore(1);   { 1 Indicates the game was won but not rubber }
  656.         OutputScore(1);
  657.         CurGame := CurGame + 1;
  658.       end
  659.       else
  660.       begin
  661.         DisplayScore(0); { 0 indicates the game was not won }
  662.         OutputScore(0);
  663.       end;
  664.     end;
  665.   end;
  666. end; { CalculateScore }
  667.  
  668. { end SCORE.BR }