Skip to content

Commit

Permalink
Merge pull request #71 from ZacharyPatten/dotnet-5
Browse files Browse the repository at this point in the history
Update To .NET 5 (plus more)
  • Loading branch information
ZacharyPatten committed Nov 21, 2020
2 parents 4b53538 + 71add55 commit 5a65841
Show file tree
Hide file tree
Showing 81 changed files with 12,777 additions and 16,715 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.png binary
2 changes: 1 addition & 1 deletion .github/workflows/Towel Continuous Integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
dotnet-version: 5.0.100
- name: dotnet build
run: dotnet build --configuration 'Release'
- name: dotnet test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Towel Deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
dotnet-version: 5.0.100
- name: dotnet pack
run: dotnet pack Sources/Towel/Towel.csproj --configuration Release /p:Version=${{ github.event.release.tag_name }} /p:PackageReleaseNotes="See https://github.com/ZacharyPatten/Towel/releases/tag/${{ github.event.release.tag_name }}"
- name: archive nuget
Expand Down
40 changes: 20 additions & 20 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build BasicsAndExtensions Example [Debug]",
"program": "${workspaceFolder}/Examples/BasicsAndExtensions/bin/Debug/netcoreapp3.1/BasicsAndExtensions.dll",
"program": "${workspaceFolder}/Examples/BasicsAndExtensions/bin/Debug/net5.0/BasicsAndExtensions.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/BasicsAndExtensions/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/BasicsAndExtensions/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -21,9 +21,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build CommandLine Example [Debug]",
"program": "${workspaceFolder}/Examples/CommandLine/bin/Debug/netcoreapp3.1/CommandLine.dll",
"program": "${workspaceFolder}/Examples/CommandLine/bin/Debug/net5.0/CommandLine.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/CommandLine/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/CommandLine/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -32,9 +32,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build ConsoleHelpers Example [Debug]",
"program": "${workspaceFolder}/Examples/ConsoleHelpers/bin/Debug/netcoreapp3.1/ConsoleHelpers.dll",
"program": "${workspaceFolder}/Examples/ConsoleHelpers/bin/Debug/net5.0/ConsoleHelpers.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/ConsoleHelpers/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/ConsoleHelpers/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -43,9 +43,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build Data Structures Example [Debug]",
"program": "${workspaceFolder}/Examples/DataStructures/bin/Debug/netcoreapp3.1/DataStructures.dll",
"program": "${workspaceFolder}/Examples/DataStructures/bin/Debug/net5.0/DataStructures.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/DataStructures/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/DataStructures/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -54,9 +54,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build GraphSearch Example [Debug]",
"program": "${workspaceFolder}/Examples/GraphSearch/bin/Debug/netcoreapp3.1/GraphSearch.dll",
"program": "${workspaceFolder}/Examples/GraphSearch/bin/Debug/net5.0/GraphSearch.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/GraphSearch/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/GraphSearch/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -65,9 +65,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build Mathematics Example [Debug]",
"program": "${workspaceFolder}/Examples/Mathematics/bin/Debug/netcoreapp3.1/Mathematics.dll",
"program": "${workspaceFolder}/Examples/Mathematics/bin/Debug/net5.0/Mathematics.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/Mathematics/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/Mathematics/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -76,9 +76,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build Measurements Example [Debug]",
"program": "${workspaceFolder}/Examples/Measurements/bin/Debug/netcoreapp3.1/Measurements.dll",
"program": "${workspaceFolder}/Examples/Measurements/bin/Debug/net5.0/Measurements.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/Measurements/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/Measurements/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -87,20 +87,20 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build OmnitreeGraphicsDemo Example [Debug]",
"program": "${workspaceFolder}/Examples/OmnitreeGraphicsDemo/bin/Debug/netcoreapp3.1/OmnitreeGraphicsDemo.dll",
"program": "${workspaceFolder}/Examples/OmnitreeGraphicsDemo/bin/Debug/net5.0/OmnitreeGraphicsDemo.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/OmnitreeGraphicsDemo/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/OmnitreeGraphicsDemo/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
{
"name": "ValueAttributes Example [Debug]",
"name": "TagAttributes Example [Debug]",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build ValueAttributes Example [Debug]",
"program": "${workspaceFolder}/Examples/ValueAttributes/bin/Debug/netcoreapp3.1/ValueAttributes.dll",
"preLaunchTask": "Build TagAttributes Example [Debug]",
"program": "${workspaceFolder}/Examples/TagAttributes/bin/Debug/net5.0/TagAttributes.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/ValueAttributes/bin/Debug/netcoreapp3.1",
"cwd": "${workspaceFolder}/Examples/TagAttributes/bin/Debug/net5.0",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand Down
22 changes: 18 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,28 +339,42 @@
"problemMatcher": "$msCompile"
},
{
"label": "Build ValueAttributes Example [Debug]",
"label": "Build TagAttributes Example [Debug]",
"command": "dotnet",
"type": "process",
"args":
[
"build",
"--configuration", "Debug",
"${workspaceFolder}/Examples/ValueAttributes/ValueAttributes.csproj",
"${workspaceFolder}/Examples/TagAttributes/TagAttributes.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary",
],
"problemMatcher": "$msCompile"
},
{
"label": "Build ValueAttributes Example [Release]",
"label": "Build TagAttributes Example [Release]",
"command": "dotnet",
"type": "process",
"args":
[
"build",
"--configuration", "Release",
"${workspaceFolder}/Examples/ValueAttributes/ValueAttributes.csproj",
"${workspaceFolder}/Examples/TagAttributes/TagAttributes.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary",
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet run Towel_Generating",
"command": "dotnet",
"type": "process",
"args":
[
"run",
"--configuration", "Release",
"${workspaceFolder}/Tools/Towel_Generating/Towel_Generating.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary",
],
Expand Down
2 changes: 1 addition & 1 deletion Examples/BasicsAndExtensions/BasicsAndExtensions.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand Down
137 changes: 71 additions & 66 deletions Examples/BasicsAndExtensions/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,103 +241,108 @@ static void Main()

Console.WriteLine(" Sorting Algorithms----------------------");
Console.WriteLine();
int[] dataSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
Console.Write($" Data Set: {string.Join(", ", dataSet.Select(x => x.ToString()))}");
Console.WriteLine();

// Shuffling (Randomizing)
Shuffle<int>(dataSet);
Console.Write($" Shuffle (Randomizing): {string.Join(", ", dataSet.Select(x => x.ToString()))}");
Console.WriteLine();

void ShuffleDataSet()
{
Console.WriteLine(" shuffling dataSet...");
Shuffle<int>(dataSet);
}
int[] dataSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

string DataSetToString() => string.Join(", ", dataSet.Select(x => x.ToString()));

Console.WriteLine();
Console.WriteLine($" Data Set: {DataSetToString()}");

Shuffle<int>(dataSet);
Console.WriteLine($" Shuffle: {DataSetToString()}");

// Bubble
SortBubble<int>(dataSet);
Console.Write($" Bubble: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Bubble: {DataSetToString()}");

// Selection
ShuffleDataSet();
Shuffle<int>(dataSet);
SortSelection<int>(dataSet);
Console.Write($" Selection: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Selection: {DataSetToString()}");

// Insertion
ShuffleDataSet();
Shuffle<int>(dataSet);
SortInsertion<int>(dataSet);
Console.Write($" Insertion: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Insertion: {DataSetToString()}");

// Quick
ShuffleDataSet();
Shuffle<int>(dataSet);
SortQuick<int>(dataSet);
Console.Write($" Quick: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Quick: {DataSetToString()}");

// Merge
ShuffleDataSet();
Shuffle<int>(dataSet);
SortMerge<int>(dataSet);
Console.Write($" Merge: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Merge: {DataSetToString()}");

// Heap
ShuffleDataSet();
Shuffle<int>(dataSet);
SortHeap<int>(dataSet);
Console.Write($" Heap: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Heap: {DataSetToString()}");

// OddEven
ShuffleDataSet();
Shuffle<int>(dataSet);
SortOddEven<int>(dataSet);
Console.Write($" OddEven: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" OddEven: {DataSetToString()}");

// Slow
ShuffleDataSet();
Shuffle<int>(dataSet);
SortSlow<int>(dataSet);
Console.Write($" Slow: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Slow: {DataSetToString()}");

// Cocktail
ShuffleDataSet();
Shuffle<int>(dataSet);
SortCocktail<int>(dataSet);
Console.Write($" Cocktail: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Cocktail: {DataSetToString()}");

// Shell
ShuffleDataSet();
Shuffle<int>(dataSet);
SortShell<int>(dataSet);
Console.Write($" Shell: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Shell: {DataSetToString()}");

// Gnome
ShuffleDataSet();
Shuffle<int>(dataSet);
SortGnome<int>(dataSet);
Console.Write($" Gnome: {DataSetToString()}");
Console.WriteLine();
Console.WriteLine($" Gnome: {DataSetToString()}");

// Comb
ShuffleDataSet();
Shuffle<int>(dataSet);
SortComb<int>(dataSet);
Console.Write($" Comb: {DataSetToString()}");
Console.WriteLine($" Comb: {DataSetToString()}");

Shuffle<int>(dataSet);
SortCycle<int>(dataSet);
Console.WriteLine($" Cycle: {DataSetToString()}");

Shuffle<int>(dataSet);
Console.WriteLine(" Bogo: Disabled (usually very slow...)");
//SortBogo<int>(dataSet);
//Console.WriteLine($" Bogo: {DataSetToString()}");

Console.WriteLine();
}
#endregion

#region IsOrdered
{
int[] a = { 1, 2, 3, 4, 5 }; // least to greatest
int[] b = { 5, 4, 3, 2, 1 }; // greatest to least
int[] c = { 1, 5, 3, 4, 2 }; // unordered
string[] d = { "a", "ba", "cba", "dcba", }; // least to greatest (strings)

// Bogo
ShuffleDataSet();
Console.Write(" Bogo: Disabled (usually very slow...)");
//Sort.Bogo(dataSet);
//Console.Write(" Bogo: " + string.Join(", ", dataSet.Select(x => x.ToString())));
Console.WriteLine(" IsOrdered------------------------------------");
Console.WriteLine();
Console.WriteLine($" IsOrdered({string.Join(", ", a)}) := {IsOrdered<int>(a)}");
Console.WriteLine($" IsOrdered({string.Join(", ", b)}, (a, b) => Compare(b, a)) := {IsOrdered<int>(b, (a, b) => Compare(b, a))}");
Console.WriteLine($" IsOrdered({string.Join(", ", c)}) := {IsOrdered<int>(c)}");
Console.WriteLine($" IsOrdered({string.Join(", ", d)}) := {IsOrdered<string>(d)}");
Console.WriteLine();
}
#endregion

#region FilterOrdered
{
int[] a = { 1, 2, 3 };
int[] b = { 1, -1, 2, -2, 3, -3 };

Console.WriteLine(" FilterOrdered------------------------------------");
Console.WriteLine();
Console.WriteLine(" Filters out values that are not in order.");
Console.WriteLine();
Console.Write($" FilterOrdered({string.Join(", ", a)}) :=");
FilterOrdered<int>(a, i => Console.Write(" " + i));
Console.WriteLine();
Console.Write($" FilterOrdered({string.Join(", ", b)}) :=");
FilterOrdered<int>(b, i => Console.Write(" " + i));
Console.WriteLine();
Console.WriteLine();
}
#endregion
Expand Down Expand Up @@ -405,7 +410,7 @@ void ShuffleDataSet()
{
string a = "book";
string b = "barf";
Console.WriteLine($@" Recursive(""{a}"", ""{b}""): {HammingDistance(a, b)}");
Console.WriteLine($@" HammingDistance(""{a}"", ""{b}""): {HammingDistance(a, b)}");
}
Console.WriteLine();
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/CommandLine/CommandLine.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<DocumentationFile>CommandLine.xml</DocumentationFile>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/ConsoleHelpers/ConsoleHelpers.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 5a65841

Please sign in to comment.