Skip to content

Commit 8536bda

Browse files
committed
Build 1.4.4.118 - Fixed #29
1 parent d53dea4 commit 8536bda

11 files changed

Lines changed: 272 additions & 169 deletions

File tree

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<br />
66

77
![Maintenance](https://img.shields.io/maintenance/yes/2020)
8-
![Build](https://img.shields.io/badge/Build-1.0.0.0-brightgreen)
8+
![Build](https://img.shields.io/badge/Build-1.4.4.118-brightgreen)
99
![GitHub release (latest by date)](https://img.shields.io/github/v/release/bomrafinha/SortingAlgorithms)
1010
![GitHub Release Date](https://img.shields.io/github/release-date/bomrafinha/SortingAlgorithms)
1111
![Github repo age](https://img.shields.io/github/issues/detail/age/bomrafinha/SortingAlgorithms/1.svg?style=flat-square)
@@ -182,7 +182,7 @@ A declaração de métodos deve ocorrer sempre dentro dos modificadores de acess
182182

183183
Métodos devem ser *camelCase*.
184184

185-
Os parâmetros do método devem ser *camelCase*.
185+
Os parâmetros do método devem ser *camelCase* iniciando com "a".
186186

187187
Procurar, quando possível, usar prefixos *get*, *set*, *eh*, etc de acordo com a função do método e/ou seu retorno.
188188

@@ -225,6 +225,12 @@ Separar declações de variáveis, métodos, construtores, destrutores e proprie
225225

226226
![Identação](documentation/images/padrao_identacao_01.png)
227227

228+
#### Chamada de métodos e variaveis internas da classe
229+
230+
Devem ser precedidas da palavra reservada *Self*, para facilitar a leitura do código.
231+
232+
![Self](documentation/images/padrao_self_01.png)
233+
228234
#### Palavras Reservadas
229235
Dá-se preferência ao uso de iniciais minúsculas para palavras reservadas. Porém isso não é uma regra para o projeto tendo em vista que por serem reservadas a IDE às sinaliza, não atrapalhando, assim, a leitura do código.
230236

@@ -240,10 +246,6 @@ Dá-se preferência ao uso de iniciais minúsculas para palavras reservadas. Por
240246
+ Estrutura básica do código
241247

242248
+ Algoritmos
243-
- Bubble Sort
244-
- Insertion Sort
245-
- Selection Sort
246-
- Comb Sort
247249
- Bogo Sort
248250
- Merge Sort
249251
- Heap Sort
@@ -275,6 +277,7 @@ SortingAlgorithms
275277
│ ├── padrao_interfaces.png
276278
│ ├── padrao_metodos.png
277279
│ ├── padrao_propriedades.png
280+
│ ├── padrao_self_01.png
278281
│ ├── padrao_variaveis_locais.png
279282
│ ├── padrao_variaveis_privadas.png
280283
│ ├── project_issue.png
116 Bytes
Loading
1.29 KB
Loading

modules/BubbleSort/U_Sort.Bubble.pas

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,20 @@ interface
77
type
88
TSortBubble = class(TSortClass, ISortInterface)
99
private
10-
procedure algoritmo(); Override;
11-
12-
public
13-
constructor Create(layout01 : TLayout);
14-
15-
procedure sort();
10+
function algoritmo() : Boolean; Override;
1611

1712
end;
1813

1914
implementation
2015

2116
{ TSortBubble }
2217

23-
constructor TSortBubble.Create(layout01: TLayout);
24-
begin
25-
inherited Create(layout01);
26-
27-
end;
28-
29-
procedure TSortBubble.sort;
30-
begin
31-
inherited sort();
32-
end;
33-
34-
procedure TSortBubble.algoritmo();
18+
function TSortBubble.algoritmo() : Boolean;
3519
var
3620
i, j : Integer;
3721

3822
begin
23+
Result := False;
3924
for i := 48 downto 0 do
4025
begin
4126
for j := 0 to i do
@@ -47,6 +32,8 @@ procedure TSortBubble.algoritmo();
4732
end;
4833
end;
4934

35+
Result := True;
36+
5037
end;
5138

5239
end.

modules/CombSort/U_Sort.Comb.pas

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,20 @@ interface
77
type
88
TSortComb = class(TSortClass, ISortInterface)
99
private
10-
procedure algoritmo(); Override;
11-
12-
public
13-
constructor Create(layout01 : TLayout);
14-
15-
procedure sort();
10+
function algoritmo() : Boolean; Override;
1611

1712
end;
1813

1914
implementation
2015

2116
{ TSortComb }
2217

23-
constructor TSortComb.Create(layout01: TLayout);
24-
begin
25-
inherited Create(layout01);
26-
27-
end;
28-
29-
procedure TSortComb.sort;
30-
begin
31-
inherited sort();
32-
33-
end;
34-
35-
procedure TSortComb.algoritmo();
18+
function TSortComb.algoritmo() : Boolean;
3619
var
3720
i, gap, tamanho : Integer;
3821

3922
begin
23+
Result := False;
4024
tamanho := 50;
4125
gap := trunc(tamanho / 1.3);
4226
while ((gap > 0) and (i <> tamanho - 1)) do
@@ -52,6 +36,7 @@ procedure TSortComb.algoritmo();
5236
end;
5337
gap := Trunc(gap / 1.3);
5438
end;
39+
Result := True;
5540

5641
end;
5742

modules/InsertionSort/U_Sort.Insertion.pas

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,21 @@ interface
77
type
88
TSortInsertion = class(TSortClass, ISortInterface)
99
private
10-
procedure algoritmo(); Override;
11-
12-
public
13-
constructor Create(layout01 : TLayout);
14-
15-
procedure sort();
10+
function algoritmo() : Boolean; Override;
1611

1712
end;
1813

1914
implementation
2015

2116
{ TSortInsertion }
2217

23-
constructor TSortInsertion.Create(layout01: TLayout);
24-
begin
25-
inherited Create(layout01);
26-
27-
end;
28-
29-
procedure TSortInsertion.sort;
30-
begin
31-
inherited sort();
32-
33-
end;
34-
35-
procedure TSortInsertion.algoritmo();
18+
function TSortInsertion.algoritmo() : Boolean;
3619
var
3720
i, j : Integer;
3821
key : Single;
3922

4023
begin
24+
Result := False;
4125
for j := 1 to 49 do
4226
begin
4327
key := findRectangle(j).Height;
@@ -51,6 +35,7 @@ procedure TSortInsertion.algoritmo();
5135

5236
end;
5337
end;
38+
Result := True;
5439
end;
5540

5641
end.

modules/SelectionSort/U_Sort.Selection.pas

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,20 @@ interface
77
type
88
TSortSelection = class(TSortClass, ISortInterface)
99
private
10-
procedure algoritmo(); Override;
11-
12-
public
13-
constructor Create(layout01 : TLayout);
14-
15-
procedure sort();
10+
function algoritmo() : Boolean; Override;
1611

1712
end;
1813

1914
implementation
2015

2116
{ TSortSelection }
2217

23-
constructor TSortSelection.Create(layout01: TLayout);
24-
begin
25-
inherited Create(layout01);
26-
27-
end;
28-
29-
procedure TSortSelection.sort;
30-
begin
31-
inherited sort();
32-
33-
end;
34-
35-
procedure TSortSelection.algoritmo();
18+
function TSortSelection.algoritmo() : Boolean;
3619
var
3720
i, j, min : Integer;
3821

3922
begin
23+
Result := False;
4024
for i := 0 to 48 do
4125
begin
4226
min := i;
@@ -49,6 +33,7 @@ procedure TSortSelection.algoritmo();
4933
end;
5034
troca(findRectangle(min), findRectangle(i));
5135
end;
36+
Result := True;
5237
end;
5338

5439
end.

project/Sorting.dproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,13 @@
298298
<DCC_DcuOutput>../output</DCC_DcuOutput>
299299
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
300300
<VerInfo_Locale>1046</VerInfo_Locale>
301-
<VerInfo_Build>60</VerInfo_Build>
301+
<VerInfo_Build>105</VerInfo_Build>
302302
<VerInfo_Debug>true</VerInfo_Debug>
303303
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
304-
<VerInfo_Keys>CompanyName=Bomrafinha;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.60;InternalName=SortingAlgorithms;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
304+
<VerInfo_Keys>CompanyName=Bomrafinha;FileDescription=$(MSBuildProjectName);FileVersion=1.4.4.105;InternalName=SortingAlgorithms;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
305305
<DCC_UnitSearchPath>../app;../output;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
306+
<VerInfo_MinorVer>4</VerInfo_MinorVer>
307+
<VerInfo_Release>4</VerInfo_Release>
306308
</PropertyGroup>
307309
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
308310
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>

0 commit comments

Comments
 (0)