Skip to content

Commit

Permalink
Add Enum project
Browse files Browse the repository at this point in the history
  • Loading branch information
cvpfus committed Sep 12, 2023
1 parent 43776d0 commit 91e73d8
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
7 changes: 7 additions & 0 deletions FormulatrixBootcamp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BoxingUnboxing", "W2 D1\Box
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoreRef", "W2 D1\MoreRef\MoreRef.csproj", "{C4365CA5-CA1C-47D8-89D8-C03E16A82144}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enum", "W2 D1\Enum\Enum.csproj", "{3B6CBE35-FC4D-4AFC-A6F9-09A7DB9B4378}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -151,6 +153,10 @@ Global
{C4365CA5-CA1C-47D8-89D8-C03E16A82144}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4365CA5-CA1C-47D8-89D8-C03E16A82144}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4365CA5-CA1C-47D8-89D8-C03E16A82144}.Release|Any CPU.Build.0 = Release|Any CPU
{3B6CBE35-FC4D-4AFC-A6F9-09A7DB9B4378}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B6CBE35-FC4D-4AFC-A6F9-09A7DB9B4378}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B6CBE35-FC4D-4AFC-A6F9-09A7DB9B4378}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B6CBE35-FC4D-4AFC-A6F9-09A7DB9B4378}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -178,5 +184,6 @@ Global
{10651B10-C0D7-4805-8AA9-03F35502C415} = {4AA51D7D-BA22-4F16-A2A3-8BD526E4CE19}
{0D3E0858-A87D-4254-9192-25510F91A630} = {4AA51D7D-BA22-4F16-A2A3-8BD526E4CE19}
{C4365CA5-CA1C-47D8-89D8-C03E16A82144} = {4AA51D7D-BA22-4F16-A2A3-8BD526E4CE19}
{3B6CBE35-FC4D-4AFC-A6F9-09A7DB9B4378} = {4AA51D7D-BA22-4F16-A2A3-8BD526E4CE19}
EndGlobalSection
EndGlobal
9 changes: 9 additions & 0 deletions W2 D1/Enum/DifficultyEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Difficulty;

public enum DifficultyEnum
{
Easy = 1,
Normal,
Hard,
Expert
}
10 changes: 10 additions & 0 deletions W2 D1/Enum/Enum.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
40 changes: 40 additions & 0 deletions W2 D1/Enum/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System.Reflection;
using Difficulty;

public class Program
{
static void Main()
{
Console.WriteLine("1. Easy");
Console.WriteLine("2. Normal");
Console.WriteLine("3. Hard");
Console.WriteLine("4. Expert");
Console.Write("Select the difficulty: ");
bool success = int.TryParse(Console.ReadLine(), out int difficultySelector);
if (success && difficultySelector >= 1 && difficultySelector <= 4)
{
switch (difficultySelector)
{
case (int) DifficultyEnum.Easy:
Console.WriteLine("Difficulty is set to Easy.");
break;
case (int) DifficultyEnum.Normal:
Console.WriteLine("Difficulty is set to Normal.");
break;
case (int) DifficultyEnum.Hard:
Console.WriteLine("Difficulty is set to Hard.");
break;
case (int) DifficultyEnum.Expert:
Console.WriteLine("Difficulty is set to Expert.");
break;
default:
Console.WriteLine("Difficulty is set to Easy.");
break;
}
}
else
{
Console.WriteLine("Difficulty is unavailable.");
}
}
}

0 comments on commit 91e73d8

Please sign in to comment.