Advertisement
believe_me

Untitled

May 22nd, 2022
442
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 17.18 KB | None | 1 0
  1. Unit SimpleFormUnit;
  2.  
  3. interface
  4.  
  5. uses
  6.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  7.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Menus, System.UITypes;
  8.  
  9. type
  10.   TMatrix = Array of array of Integer;
  11.   TSimpleForm = class(TForm)
  12.     Menu: TMainMenu;
  13.     Instruction: TMenuItem;
  14.     Developer: TMenuItem;
  15.     procedure InstructionClick(Sender: TObject);
  16.     procedure DeveloperClick(Sender: TObject);
  17.     Procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  18.     procedure SetInstructions(); virtual;
  19.     procedure FormCreate(Sender: TObject);
  20.     procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual;
  21.     Procedure FormCloseQueryNope(Sender: TObject; var CanClose: Boolean);
  22.   private
  23.     { Private declarations }
  24.   protected
  25.     Instructions: String;
  26.   public
  27.     { Public declarations }
  28.   end;
  29.  
  30. var
  31.   SimpleForm: TSimpleForm;
  32.  
  33. implementation
  34.  
  35. {$R *.dfm}
  36.  
  37. procedure TSimpleForm.DeveloperClick(Sender: TObject);
  38. begin
  39.     ShowMessage('Yegor Rusakovich, 151002');
  40. end;
  41.  
  42. procedure TSimpleForm.InstructionClick(Sender: TObject);
  43. begin
  44.     ShowMessage(Instructions);
  45. end;
  46.  
  47. Procedure TSimpleForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  48. begin
  49.     CanClose := False;
  50.     if MessageDlg('Are you sure you want to quit?',mtConfirmation, mbOKCancel, 0) = mrOk then
  51.     begin
  52.         CanClose := True;
  53.     end;
  54. end;
  55.  
  56. Procedure TSimpleForm.FormCloseQueryNope(Sender: TObject; var CanClose: Boolean);
  57. Begin
  58.     CanClose := True;
  59. End;
  60.  
  61. procedure TSimpleForm.SetInstructions();
  62. begin
  63.     Instructions := 'Press F1 to see this message.' + #13#10 + 'Press F3 to estimate the authors name.' + #13#10 + 'Press escape to close window.'+#13#10;
  64. end;
  65.  
  66. procedure TSimpleForm.FormCreate(Sender: TObject);
  67. begin
  68.     SetInstructions;
  69. end;
  70.  
  71. procedure TSimpleForm.FormKeyDown(Sender: TObject; var Key: Word;
  72.   Shift: TShiftState);
  73. begin
  74.     if (Key = VK_ESCAPE) then
  75.         Self.Close;
  76. end;
  77.  
  78.  
  79. end.
  80.  
  81. unit InputUnit;
  82.  
  83. interface
  84.  
  85. uses
  86.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  87.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, SimpleFormUnit, Vcl.Menus, Vcl.Grids,
  88.   Vcl.StdCtrls, Vcl.Samples.Spin, Vcl.Buttons, GraphUnit, GraphVisionUnit, System.UITypes, ShellApi;
  89.  
  90. type
  91.   TInputForm = class(TSimpleForm)
  92.     btnDone: TBitBtn;
  93.     edtVCount: TSpinEdit;
  94.     grdIncedence: TStringGrid;
  95.     OpenDialog: TOpenDialog;
  96.     SaveDialog: TSaveDialog;
  97.     FileMenu: TMenuItem;
  98.     SaveFile: TMenuItem;
  99.     OpenFile: TMenuItem;
  100.     procedure SaveFileClick(Sender: TObject);
  101.     procedure OpenFileClick(Sender: TObject);
  102.     procedure btnDoneClick(Sender: TObject);
  103.     procedure edtVCountChange(Sender: TObject);
  104.     procedure grdIncedenceSetEditText(Sender: TObject; ACol, ARow: Integer;
  105.       const Value: string);
  106.     procedure FormCreate(Sender: TObject);
  107.     procedure CreateGraphPicture();
  108.     procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  109.     procedure SetInstructions(); override;
  110.   end;
  111.  
  112. var
  113.   InputForm: TInputForm;
  114.   IsProcessed: Boolean = False;
  115.  
  116. implementation
  117.  
  118. {$R *.dfm}
  119.  
  120. function TrySetOutputFile(var SF: TextFile; const Name: String): Boolean;
  121. Begin
  122.     Result := True;
  123.     AssignFile(SF, Name);
  124.     Try
  125.         Rewrite(SF);
  126.     Except
  127.         Result := False;
  128.     End;
  129. End;
  130.  
  131. Function TrySetInputFile(var IFile: TextFile; const Name: String): Boolean;
  132. Begin
  133.     Result := True;
  134.     AssignFile(IFile, Name);
  135.     Try
  136.         Reset(IFile);
  137.     Except
  138.         Result := False;
  139.     End;
  140. End;
  141.  
  142. procedure OpenFromFile(var IFile: TextFile; var Grid: TStringGrid; var Edt: TSpinEdit);
  143. Var
  144.     I, J, Width: Integer;
  145.     Str: String;
  146.     Buffer: Char;
  147. Begin
  148.     Readln(IFile, Width);
  149.     Edt.Text := IntToStr(Width);
  150.     for I := 1 to Grid.RowCount-1 do
  151.     Begin
  152.         for J := 0 to 1 do
  153.         Begin
  154.             Buffer := 'f';
  155.             Str := '';
  156.             While (Buffer <> ' ') And (J = 0) do
  157.             Begin
  158.                 Read(IFile, Buffer);
  159.                 Str := Str + buffer;
  160.             End;
  161.             If (J = 1) Then
  162.             Begin
  163.                 Read(IFile, Str);
  164.             End;
  165.             Grid.Cells[J, I] := Str;
  166.         End;
  167.         Readln(IFile);
  168.     End;
  169. End;
  170.  
  171. procedure SaveInFile(var SF: TextFile; const Grid: TStringGrid);
  172. Var
  173.     I, J: Integer;
  174. Begin
  175.     Writeln(SF, Grid.RowCount-1);
  176.     for I := 1 to Grid.RowCount-1 do
  177.     Begin
  178.         for J := 0 to Grid.ColCount-1 do
  179.         Begin
  180.             Write(SF, Grid.Cells[J, I]);
  181.             Write(SF, ' ');
  182.         End;
  183.         Writeln(SF);
  184.     End;
  185. End;
  186.  
  187. procedure SetGridSize(const Width, Height: Integer; var Grid: TStringGrid);
  188. Var
  189.     I: Integer;
  190. begin
  191.     Grid.ColCount := Width+1;
  192.     Grid.RowCount := Height+1;
  193.     for I := 1 to Height do
  194.     Begin
  195.         Grid.Cells[I, 0] := IntToStr(I);
  196.         Grid.Cells[0, I] := IntToStr(I);
  197.     End;
  198.     Grid.Width := (width+1)*Grid.DefaultColWidth + 15;
  199.     Grid.Height := (height+1)*Grid.DefaultRowHeight + 15;
  200. end;
  201.  
  202. procedure TInputForm.SetInstructions;
  203. Const
  204.     NEW_LINE = #13#10;
  205. Begin
  206.     inherited;
  207.     Instructions := Instructions+'This program takes your input in incident list,'+NEW_LINE
  208.         +'makes depth-first search and output graph and DFS-information.'+NEW_LINE
  209.             +'1. Fullfill grid.'+NEW_LINE+'2. Press enter to process.'
  210.                 +NEW_LINE+'3. Press Show result button to see result.';
  211. End;
  212.  
  213. procedure TInputForm.btnDoneClick(Sender: TObject);
  214. begin
  215.     if IsProcessed then
  216.     Begin
  217.         if not Assigned(GraphForm) then
  218.             GraphForm := TGraphForm.Create(Self);
  219.         GraphForm.Show;
  220.         IsProcessed := False;
  221.     End
  222.     Else
  223.         MessageDlg('Your data was not processed. Press enter, please', mtError, [mbOk], 0);
  224. end;
  225.  
  226. procedure TInputForm.edtVCountChange(Sender: TObject);
  227. Const
  228.     WINDOW_DEFAULT_HEIGHT = 150;
  229. begin
  230.     SetGridSize(1, StrToint(edtVCount.Text), grdIncedence);
  231.     if grdIncedence.height > ClientHeight-WINDOW_DEFAULT_HEIGHT then
  232.         ClientHeight := grdIncedence.height+WINDOW_DEFAULT_HEIGHT;
  233. end;
  234.  
  235. procedure TInputForm.FormCreate(Sender: TObject);
  236. begin
  237.   inherited;
  238.     grdIncedence.Cells[0,0] := 'V';
  239.     grdIncedence.Cells[1,0] := '1';
  240.     grdIncedence.Cells[0,1] := '1';
  241.  
  242. end;
  243.  
  244. procedure TInputForm.FormKeyDown(Sender: TObject; var Key: Word;
  245.   Shift: TShiftState);
  246. Const
  247.     ENTER = 13;
  248.     INFO = 'Your information is processed, thanks.';
  249.     EXCEPTION = 'Input iformation in your incident list.';
  250. begin
  251.   inherited;
  252.     if Key = ENTER then
  253.     Begin
  254.         AnalyseList(grdIncedence, IncList, grdIncedence.RowCount-1);
  255.         if IncList <> Nil then
  256.         Begin
  257.             InitDFSGraph(grdIncedence.RowCount-1, DS);
  258.             DFS(DS);
  259.             SaveGraph(ConvertGraphInString(IncList));
  260.             CreateGraphPicture();
  261.             IsProcessed := True;
  262.             MessageDlg(INFO, mtInformation, [mbOk], 0)
  263.         End
  264.         Else
  265.             MessageDlg(EXCEPTION, mtError, [mbOk], 0);
  266.     End;
  267. end;
  268.  
  269. procedure TInputForm.grdIncedenceSetEditText(Sender: TObject; ACol,
  270.   ARow: Integer; const Value: string);
  271. begin
  272.     if not IsItValidStr(Value, (Sender as TStringGrid).RowCount-1) then
  273.     Begin
  274.         MessageDlg('Wrong content!', mtError, [mbOk], 0);
  275.         (Sender as TStringGrid).Cells[ACol, ARow] := '';
  276.     End;
  277. end;
  278.  
  279. procedure TInputForm.OpenFileClick(Sender: TObject);
  280. Var
  281.     OFile: TextFile;
  282. begin
  283.     if OpenDialog.Execute then
  284.     Begin
  285.         If FileExists(OpenDialog.FileName) then
  286.         Begin
  287.             if TrySetInputFile(OFile, OpenDialog.FileName) then
  288.             Begin
  289.                 OpenFromFile(OFile, Self.grdIncedence, edtVCount);
  290.                 CloseFile(OFile);
  291.             End
  292.             Else
  293.                 MessageDlg('Something was wrong', mtError, [mbOk], 0);
  294.         End;
  295.     End;
  296. end;
  297.  
  298. procedure TInputForm.SaveFileClick(Sender: TObject);
  299. Var
  300.     SFile: TextFile;
  301. begin
  302.     if SaveDialog.Execute then
  303.     Begin
  304.         If FileExists(SaveDialog.FileName) then
  305.         Begin
  306.             if TrySetOutputFile(SFile, SaveDialog.FileName) then
  307.             Begin
  308.                 SaveInFile(SFile, Self.grdIncedence);
  309.                 CloseFile(SFile);
  310.                 MessageDlg('Successfully saved', mtInformation, [mbOk], 0);
  311.             End
  312.             Else
  313.                 MessageDlg('Something was wrong', mtError, [mbOk], 0);
  314.         End;
  315.     End;
  316. end;
  317.  
  318. procedure TInputForm.CreateGraphPicture();
  319. Begin
  320.     ShellExecute(Handle, nil, 'cmd.exe', PChar(CREATE_GRAPH_PICTURE_COMMAND), nil, SW_HIDE)
  321. End;
  322.  
  323. end.
  324.  
  325. unit GraphVisionUnit;
  326.  
  327. interface
  328.  
  329. uses
  330.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  331.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, SimpleFormUnit, Vcl.Menus, Vcl.ExtCtrls, GraphUnit, Vcl.Imaging.PNGImage;
  332.  
  333. type
  334.   TGraphForm = class(TSimpleForm)
  335.     GraphPicture: TImage;
  336.     procedure FormShow(Sender: TObject);
  337.     procedure SetInstructions(); override;
  338.   end;
  339.  
  340. var
  341.   GraphForm: TGraphForm;
  342.  
  343. implementation
  344.  
  345. {$R *.dfm}
  346.  
  347. procedure TGraphForm.SetInstructions;
  348. Const
  349.     NEW_LINE = #13#10;
  350. Begin
  351.     inherited;
  352.     Instructions := Instructions + 'Number that is out of node is virtex number.'+NEW_LINE
  353.         +'In the node spase first number is the order of discovering the node by DFS'+NEW_LINE
  354.             +'Second number after ''/'' is the order of finished DFS in this node.';
  355. End;
  356.  
  357. procedure TGraphForm.FormShow(Sender: TObject);
  358. begin
  359.   inherited;
  360.     GraphPicture.Picture.LoadFromFile(GRAPH_PICTURE_FILE);
  361.     Self.ClientHeight := GraphPicture.Picture.Height;
  362.     Self.ClientWidth := GraphPicture.Picture.Width;
  363. end;
  364.  
  365. end.
  366.  
  367. unit GraphUnit;
  368.  
  369. interface
  370.  
  371. uses  Vcl.GRids, System.SysUtils;
  372.  
  373. Type
  374.  
  375.     PVirtex = ^TVirtex;
  376.     TVirtex = record
  377.         El: Integer;
  378.         Next: PVirtex;
  379.     end;
  380.     PList = ^TList;
  381.     TList = Record
  382.         Virtex: Integer;
  383.         Incedent: PVirtex;
  384.         Next: PList;
  385.     End;
  386.     TColor = (WHITE, GRAY, BLACK);
  387.     TDFSEl = record
  388.         Value: Integer;
  389.         Color: TColor;
  390.         Prev: Integer;
  391.         DTime: Integer;
  392.         FTime: Integer;
  393.     end;
  394.     TDFSGraph = array of TDFSEl;
  395.  
  396.     procedure AnalyseList(const Grid: TStringGrid; var IncList: PList; MaxV: Integer);
  397.     function IsItValidStr(const Value:String; MaxV: Integer): Boolean;
  398.     function ConvertGraphInString(IncList: PList): String;
  399.     procedure SaveGraph(const Graph: String);
  400.     procedure DFS(var DFSGr: TDFSGraph);
  401.     procedure DFS_Visit(var DFSGr: TDFSGraph; Cell: Integer);
  402.     procedure InitDFSGraph(VAmount: Integer; var Graph: TDFSGraph);
  403. Var
  404.     IncList: Plist;
  405.     DS: TDFSgraph;
  406.  
  407. Const
  408.     GRAPH_FILE = '../../GraphsFiles/text_graph.gv';
  409.     GRAPH_PICTURE_FILE = '../../GraphsFiles/picture.png';
  410.     CREATE_GRAPH_PICTURE_COMMAND = '/C "C:\Program Files\Graphviz\bin\dot.exe" -Tpng C:\Users\yegorrusakovich\Documents\Embarcadero\Studio\Projects\7_block\7.1\GraphsFiles\text_graph.gv -o C:\Users\yegorrusakovich\Documents\Embarcadero\Studio\Projects\7_block\7.1\GraphsFiles\picture.png';
  411.  
  412. implementation
  413. Var
  414.     Time: Integer;
  415.  
  416. Procedure ClearList(var List: PList);
  417. Var
  418.     DelV: PVirtex;
  419.     Del : PList;
  420. Begin
  421.     While(List <> Nil) do
  422.     Begin
  423.         while List^.Incedent <> Nil do
  424.         Begin
  425.             DelV := List^.Incedent;
  426.             List^.Incedent := List^.Incedent^.Next;
  427.             Dispose(DelV);
  428.         End;
  429.         Del := List;
  430.         List := List^.Next;
  431.         Dispose(Del);
  432.     End;
  433. End;
  434.  
  435.  
  436. procedure AddtoList(var List: PList; V: Integer; N: Integer);
  437. Var
  438.     Find: Boolean;
  439.     Save, Temp: PList;
  440.     InTemp: PVirtex;
  441. Begin
  442.     Find := False;
  443.     if List = Nil then
  444.     Begin
  445.         New(List);
  446.         List^.Virtex := V;
  447.         New(List^.Incedent);
  448.         List^.Incedent^.El := N;
  449.         List^.Next := Nil;
  450.         List^.Incedent^.Next := Nil;
  451.         Find := True;
  452.     End;
  453.     Temp := List;
  454.     while (not Find) And (Temp <> Nil) do
  455.     Begin
  456.         if Temp^.Virtex = V then
  457.         Begin
  458.             InTemp := Temp^.Incedent;
  459.             While(InTemp^.Next  <> Nil) do
  460.                 InTemp := InTemp^.Next;
  461.             Find := True;
  462.             New(InTemp^.Next);
  463.             InTemp := InTemp^.Next;
  464.             InTemp^.El := N;
  465.             InTemp^.Next := Nil;
  466.         End
  467.         Else
  468.         Begin
  469.             if Temp^.Next = Nil then
  470.                 Save := Temp;
  471.             Temp := Temp^.Next;
  472.         End;
  473.     End;
  474.     if not Find then
  475.     Begin
  476.         New(Save^.Next);
  477.         Save := Save^.Next;
  478.         Save^.Virtex := V;
  479.         New(Save^.Incedent);
  480.         Save^.Incedent^.El := N;
  481.         Save.Next := Nil;
  482.         Save^.Incedent^.Next := Nil;
  483.     End;
  484. End;
  485.  
  486. function IsItValidStr(const Value:String; MaxV: Integer): Boolean;
  487. Const
  488.     VALID_ARRAY: array [1..11] of String[1] = ('0','1', '2', '3', '4', '5', '6', '7', '8', '9', ' ');
  489.     MIN_V = 1;
  490. function IsNumbCorrect(const Buff: String): Boolean;
  491. Var
  492.     N: Integer;
  493. Begin
  494.     Result := True;
  495.     N := StrToInt(Buff);
  496.     if (N > MaxV) Or (N < MIN_V) then
  497.         Result := False;
  498. End;
  499. Var
  500.     I, J: Integer;
  501.     Find: Boolean;
  502.     Buffer: String[2];
  503. Begin
  504.     Result := True;
  505.     I := 1;
  506.     Buffer := '';
  507.     While (I <= Length(Value)) And (Result) do
  508.     Begin
  509.         Find := False;
  510.         J := 1;
  511.         While(J <= Length(VALID_ARRAY)) And (not Find) Do
  512.         Begin
  513.             if Value[I] = VALID_ARRAY[J] then
  514.                 Find := True;
  515.             Inc(J);
  516.         End;
  517.         if Value[I] <> ' ' then
  518.             Buffer := Buffer + Value[I]
  519.         Else
  520.         Begin
  521.             Find := IsNumbCorrect(Buffer);
  522.             Buffer := '';
  523.         End;
  524.         if not Find then
  525.             Result := Find;
  526.         Inc(I);
  527.     End;
  528.     if buffer <> '' then
  529.         Result := IsNumbCorrect(Buffer);
  530. End;
  531.  
  532. procedure AnalyseStr(const Value: String; Row: INteger; var IncList: PList);
  533. Var
  534.     Reader: String[2];
  535.     I, N, ErrorCode: Integer;
  536. procedure AddNumberToList();
  537. Begin
  538.     Val(Reader, N, ErrorCode);
  539.     if ErrorCode = 0 then
  540.         AddToList(IncList, Row, N);
  541. End;
  542. begin
  543.     Reader := '';
  544.     For I := 1 to Length(Value) do
  545.     Begin
  546.         If Value[I] <> ' ' then
  547.             Reader := Reader+Value[I]
  548.         Else
  549.         Begin
  550.             AddNumberToList;
  551.             Reader := '';
  552.         End;
  553.     End;
  554.     AddNumberToList;
  555. end;
  556.  
  557. procedure AnalyseList(const Grid: TStringGrid; var IncList: PList; MaxV: Integer);
  558. Var
  559.     I: Integer;
  560. begin
  561.     if IncList <> Nil then
  562.         ClearList(IncList);
  563.     for I := 1 to Grid.RowCount-1 do
  564.     Begin
  565.         if IsItValidStr(Grid.Cells[1, I], MaxV) then
  566.             AnalyseStr(Grid.Cells[1, I], I, IncList);
  567.     End;
  568. end;
  569.  
  570. function ConvertGraphInString(IncList: PList): String;
  571. Const
  572.     GRAPH_DEFAULT_STILE = 'digraph G { graph [ dpi = 300];';
  573. Var
  574.     Virtex, Numb, DiscoveredTime, FinishedTime: String;
  575.     I: Integer;
  576. Begin
  577.     Result := GRAPH_DEFAULT_STILE;
  578.     Result := Result+' forcelabels = true layout = neato ';
  579.     for I := 0 to Length(DS) - 1 do
  580.     Begin
  581.         Numb := IntToStr(I+1);
  582.         DiscoveredTime := IntToStr(DS[I].DTime);
  583.         FinishedTime := IntToStr(DS[I].FTime);
  584.         Result := Concat(Result, Numb, ' [xlabel = "', Numb,'", ', ' label = "', DiscoveredTime, '/', FinishedTime,'"] ');
  585.     End;
  586.     while IncList <> Nil do
  587.     Begin
  588.         Virtex := IntToStr(IncList^.Virtex);
  589.         while IncList^.Incedent <> Nil do
  590.         Begin
  591.             Result := Result + Virtex + '->' + IntToStr(IncList^.Incedent^.El) + ' ';
  592.             IncList^.Incedent := IncList^.Incedent^.Next;
  593.         End;
  594.         Inclist := IncList^.Next;
  595.     End;
  596.     Result := Result + ' }';
  597. End;
  598.  
  599. procedure SaveGraph(const Graph: String);
  600. Var
  601.     GraphFile: TextFile;
  602. Begin
  603.     AssignFile(GraphFile, GRAPH_FILE);
  604.     Rewrite(GraphFile);
  605.     Write(GraphFile, Graph);
  606.     CloseFile(GraphFile);
  607. End;
  608.  
  609. procedure DFS(var DFSGr: TDFSGraph);
  610. Var
  611.     I: Integer;
  612. Begin
  613.     Time := 0;
  614.     for I := 0 to Length(DFSGr)-1 do
  615.     Begin
  616.         if DFSGr[I].Color = WHITE then
  617.             DFS_Visit(DFSgr, I)
  618.     End;
  619. End;
  620.  
  621. procedure DFS_Visit(var DFSGr: TDFSGraph; Cell: Integer);
  622. Var
  623.     IncidentV: PVirtex;
  624.     Temp: PList;
  625. Begin
  626.     Inc(Time);
  627.     DFSgr[Cell].DTime := Time;
  628.     DFSGr[Cell].Color := GRAY;
  629.     Temp := IncList;
  630.     While(DFSGr[Cell].Value <> Temp^.Virtex) Do
  631.         Temp := Temp^.Next;
  632.     IncidentV := Temp^.Incedent;
  633.     while IncidentV <> Nil do
  634.     Begin
  635.         if DFSgr[IncidentV^.El-1].Color = WHITE then
  636.         Begin
  637.             DFSgr[IncidentV^.El-1].Prev := Cell+1;
  638.             DFS_Visit(DFSGr, IncidentV^.El-1);
  639.         End;
  640.         IncidentV := IncidentV^.Next;
  641.     End;
  642.     DFSGr[Cell].Color := BLACK;
  643.     Inc(Time);
  644.     DFSGr[Cell].FTime := Time;
  645. End;
  646.  
  647. procedure InitDFSGraph(VAmount: Integer; var Graph: TDFSGraph);
  648. Var
  649.     I: Integer;
  650. Begin
  651.     SetLength(Graph, VAmount);
  652.     for I := 0 to VAmount-1 do
  653.     Begin
  654.         Graph[I].Value := I+1;
  655.         Graph[I].Color := WHITE;
  656.         Graph[I].Prev := 0;
  657.     End;
  658. End;
  659.  
  660. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement