mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-12-08 00:45:29 +01:00
feat(languages): add C# support
This commit is contained in:
parent
677a55a9d8
commit
719058b2ff
@ -21,6 +21,7 @@ Each challenge has its **solutions**, its **instructions** and **input/output ex
|
|||||||
### ✅ Programming languages available
|
### ✅ Programming languages available
|
||||||
|
|
||||||
- [C/C++ (gcc)](https://gcc.gnu.org/)
|
- [C/C++ (gcc)](https://gcc.gnu.org/)
|
||||||
|
- [C# (.NET Core)](https://docs.microsoft.com/en-us/dotnet/csharp/)
|
||||||
- [Dart](https://dart.dev/)
|
- [Dart](https://dart.dev/)
|
||||||
- [JavaScript/TypeScript (Node.js)](https://nodejs.org/)
|
- [JavaScript/TypeScript (Node.js)](https://nodejs.org/)
|
||||||
- [Python](https://www.python.org/)
|
- [Python](https://www.python.org/)
|
||||||
|
3
challenges/hello-world/solutions/cs/function/README.md
Normal file
3
challenges/hello-world/solutions/cs/function/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# hello-world/cs/function
|
||||||
|
|
||||||
|
Created by [@Divlo](https://github.com/Divlo) on 24 June 2021.
|
15
challenges/hello-world/solutions/cs/function/Solution.cs
Normal file
15
challenges/hello-world/solutions/cs/function/Solution.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
namespace Solution
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
string line;
|
||||||
|
while ((line = System.Console.ReadLine()) != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
System.Console.WriteLine($"Hello, {line}!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
challenges/hello-world/solutions/cs/function/cs.csproj
Normal file
6
challenges/hello-world/solutions/cs/function/cs.csproj
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
@ -6,7 +6,7 @@ import { Solution } from './Solution'
|
|||||||
const git = simpleGit()
|
const git = simpleGit()
|
||||||
|
|
||||||
const solutionsRegex = new RegExp(
|
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 {
|
class GitAffected {
|
||||||
|
5
templates/docker/cs/Dockerfile
Normal file
5
templates/docker/cs/Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY ./ ./
|
||||||
|
RUN dotnet restore
|
||||||
|
ENTRYPOINT ["dotnet", "run"]
|
15
templates/solution/cs/Solution.cs
Normal file
15
templates/solution/cs/Solution.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
namespace Solution
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
string line;
|
||||||
|
while ((line = System.Console.ReadLine()) != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
System.Console.WriteLine($"Hello, {line}!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
templates/solution/cs/cs.csproj
Normal file
6
templates/solution/cs/cs.csproj
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
Loading…
Reference in New Issue
Block a user