Changeset 109 for trunk/Board.pas


Ignore:
Timestamp:
Dec 10, 2024, 10:38:11 AM (5 weeks ago)
Author:
chronos
Message:
  • Modified: Added more score information.
  • Fixed: Record only non-zero scores.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Board.pas

    r105 r109  
    2020    procedure Clear;
    2121    procedure ClearMerged;
     22    function GetBiggestTile: Integer;
    2223    function GetValueSum: Integer;
    2324    function GetHighestTileValue: Integer;
     
    122123end;
    123124
     125function TBoard.GetBiggestTile: Integer;
     126var
     127  X, Y: Integer;
     128begin
     129  Result := 0;
     130  for Y := 0 to Size.Y - 1 do
     131    for X := 0 to Size.X - 1 do
     132      if not Tiles[Y, X].Disabled and
     133      not Tiles[Y, X].Unmergeable and
     134      (Tiles[Y, X].Value > Result) then Result := Tiles[Y, X].Value;
     135end;
     136
    124137function TBoard.GetValueSum: Integer;
    125138var
Note: See TracChangeset for help on using the changeset viewer.