Skip to content

Commit

Permalink
Released v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiagoDSMarcelino committed Jul 6, 2023
1 parent 6fba17f commit ff5d692
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
31 changes: 15 additions & 16 deletions src/BogoLib.Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
using System.Drawing;
using System.Text;

StringBuilder sb = new();

// ConvexHull Test
var points = new PointF[]
{
// Square Test
Expand All @@ -21,28 +24,24 @@
//new PointF(1.7f, -3)
};

StringBuilder sb = new();

var test = points.BogoConvexHull();

sb.Append("\n\nConvexHull = { ");
sb.Append("ConvexHull = { ");
foreach (var point in test)
sb.Append($"({point.X}, {point.Y}); ");

sb.Append("} n = " + test.Length);

sb.Append("\n\n\n");

Console.WriteLine(sb.ToString());
sb.Append("} n = " + test.Length + '\n');

// Sorting Test
//var arr = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
//var descendingArr = arr.BogoSort(true);
var arr = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var sortedArr = arr.BogoSort(true);
sb.Append("\nSorted array:\n");
foreach (var item in sortedArr)
sb.Append($"{item}, ");


// Square root Test
//Console.WriteLine(BogoMath.BogoSqrt(27));
sb.Append($"\n\nSquare root of 27 = {BogoMath.BogoSqrt(27)}\n");

// Find Test
//Console.WriteLine(arr.BogoFind(8));
//foreach (var item in descendingArr)
// Console.Write($"{item}, ");
sb.Append($"\n\nIndex of number 9 in the sorted array: {sortedArr.BogoFind(9)}");

Console.WriteLine(sb.ToString());
9 changes: 6 additions & 3 deletions src/BogoLib/BogoLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>

<PackageId>BogoLib</PackageId>
<Authors>Thiago dos Santos Marcelino</Authors>
<PackageVersion>0.1.0</PackageVersion>
<PackageId>BogoLib</PackageId>
<Authors>
Thiago dos Santos Marcelino,
Marcos Augusto Belizario
</Authors>
<PackageVersion>0.2.0</PackageVersion>
</PropertyGroup>

</Project>

0 comments on commit ff5d692

Please sign in to comment.