diff --git a/README.md b/README.md index 5326674..469f644 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Each challenge has its **solutions**, its **instructions** and **input/output ex ### ✅ Programming languages available - [C/C++ (gcc)](https://gcc.gnu.org/) +- [C# (.NET Core)](https://docs.microsoft.com/en-us/dotnet/csharp/) - [Dart](https://dart.dev/) - [JavaScript/TypeScript (Node.js)](https://nodejs.org/) - [Python](https://www.python.org/) diff --git a/challenges/hello-world/solutions/cs/function/README.md b/challenges/hello-world/solutions/cs/function/README.md new file mode 100644 index 0000000..e2ef5c9 --- /dev/null +++ b/challenges/hello-world/solutions/cs/function/README.md @@ -0,0 +1,3 @@ +# hello-world/cs/function + +Created by [@Divlo](https://github.com/Divlo) on 24 June 2021. diff --git a/challenges/hello-world/solutions/cs/function/Solution.cs b/challenges/hello-world/solutions/cs/function/Solution.cs new file mode 100644 index 0000000..2ca42b3 --- /dev/null +++ b/challenges/hello-world/solutions/cs/function/Solution.cs @@ -0,0 +1,15 @@ +namespace Solution +{ + class Program + { + static void Main() + { + string line; + while ((line = System.Console.ReadLine()) != null) + { + + System.Console.WriteLine($"Hello, {line}!"); + } + } + } +} diff --git a/challenges/hello-world/solutions/cs/function/cs.csproj b/challenges/hello-world/solutions/cs/function/cs.csproj new file mode 100644 index 0000000..dbc7a12 --- /dev/null +++ b/challenges/hello-world/solutions/cs/function/cs.csproj @@ -0,0 +1,6 @@ + + + Exe + net5.0 + + diff --git a/cli/services/GitAffected.ts b/cli/services/GitAffected.ts index 1e8246a..eae3200 100644 --- a/cli/services/GitAffected.ts +++ b/cli/services/GitAffected.ts @@ -6,7 +6,7 @@ import { Solution } from './Solution' const git = simpleGit() const solutionsRegex = new RegExp( - /challenges\/[\s\S]*\/solutions\/(c|cpp|dart|javascript|python|rust|typescript)\/[\s\S]*\/solution.(c|cpp|dart|js|py|rs|ts)/ + /challenges\/[\s\S]*\/solutions\/(c|cpp|cs|dart|javascript|python|rust|typescript)\/[\s\S]*\/(solution|Solution).(c|cpp|cs|dart|js|py|rs|ts)/ ) class GitAffected { diff --git a/templates/docker/cs/Dockerfile b/templates/docker/cs/Dockerfile new file mode 100644 index 0000000..c71206e --- /dev/null +++ b/templates/docker/cs/Dockerfile @@ -0,0 +1,5 @@ +FROM mcr.microsoft.com/dotnet/sdk:5.0 +WORKDIR /usr/src/app +COPY ./ ./ +RUN dotnet restore +ENTRYPOINT ["dotnet", "run"] diff --git a/templates/solution/cs/Solution.cs b/templates/solution/cs/Solution.cs new file mode 100644 index 0000000..2ca42b3 --- /dev/null +++ b/templates/solution/cs/Solution.cs @@ -0,0 +1,15 @@ +namespace Solution +{ + class Program + { + static void Main() + { + string line; + while ((line = System.Console.ReadLine()) != null) + { + + System.Console.WriteLine($"Hello, {line}!"); + } + } + } +} diff --git a/templates/solution/cs/cs.csproj b/templates/solution/cs/cs.csproj new file mode 100644 index 0000000..dbc7a12 --- /dev/null +++ b/templates/solution/cs/cs.csproj @@ -0,0 +1,6 @@ + + + Exe + net5.0 + +