diff --git a/CSharplearning.sln b/CSharplearning.sln index 0ceb633..6021e6c 100644 --- a/CSharplearning.sln +++ b/CSharplearning.sln @@ -7,7 +7,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Set1Task2", "Set1Task2\Set1 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Set1Task3", "Set1Task3\Set1Task3.csproj", "{A585E0AB-2EDD-451D-888D-C7520C6F7274}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Set1Task5", "Set1Task5\Set1Task5.csproj", "{7D5CF5FF-A5C2-4188-9BC4-4BF50CBED4C0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Set1Task5", "Set1Task5\Set1Task5.csproj", "{7D5CF5FF-A5C2-4188-9BC4-4BF50CBED4C0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Set1Task6", "Set1Task6\Set1Task6.csproj", "{B6C410B4-B008-4F2B-9BB0-2FBC8CBB8B37}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -27,6 +29,10 @@ Global {7D5CF5FF-A5C2-4188-9BC4-4BF50CBED4C0}.Debug|Any CPU.Build.0 = Debug|Any CPU {7D5CF5FF-A5C2-4188-9BC4-4BF50CBED4C0}.Release|Any CPU.ActiveCfg = Release|Any CPU {7D5CF5FF-A5C2-4188-9BC4-4BF50CBED4C0}.Release|Any CPU.Build.0 = Release|Any CPU + {B6C410B4-B008-4F2B-9BB0-2FBC8CBB8B37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6C410B4-B008-4F2B-9BB0-2FBC8CBB8B37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6C410B4-B008-4F2B-9BB0-2FBC8CBB8B37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B6C410B4-B008-4F2B-9BB0-2FBC8CBB8B37}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Set1Task6/Program.cs b/Set1Task6/Program.cs new file mode 100644 index 0000000..f31bd32 --- /dev/null +++ b/Set1Task6/Program.cs @@ -0,0 +1,64 @@ +using System; + +namespace Set1Task6 +{ + internal class Program + { + static void Main(string[] args) + { + Random dice = new Random(); + int player1 = dice.Next(1,7); + int player2 = dice.Next(1,7); + int player3 = dice.Next(1, 7); + int player4 = dice.Next(1, 7); + int player5 = dice.Next(1, 7); + + Console.WriteLine("Player 1: " + player1); + Console.WriteLine("Player 2: " + player2); + Console.WriteLine("Player 3: " + player3); + Console.WriteLine("Player 4: " + player4); + Console.WriteLine("Player 5: " + player5); + + if ((player1 == player2)|| (player1 == player3)|| (player1 == player4)|| (player1 == player5)) + { + Console.WriteLine("Player1 won the game and moved to next level"); + } + else + { + Console.WriteLine("Player1 didnt move to the next level"); + } + if ((player2 == player1) || (player2 == player3) || (player2 == player4) || (player2 == player5)) + { + Console.WriteLine("Player2 won the game and moved to next level"); + } + else + { + Console.WriteLine("Player2 didnt move to the next level"); + } + if ((player3 == player1) || (player3 == player2) || (player3 == player4) || (player3 == player5)) + { + Console.WriteLine("Player3 won the game and moved to next level"); + } + else + { + Console.WriteLine("Player3 didnt move to the next level"); + } + if ((player4 == player1) || (player4 == player2) || (player4 == player3) || (player4 == player5)) + { + Console.WriteLine("Player4 won the game and moved to next level"); + } + else + { + Console.WriteLine("Player4 didnt move to the next level"); + } + if ((player5 == player1) || (player5 == player2) || (player5 == player3) || (player5 == player4)) + { + Console.WriteLine("Player5 won the game and moved to next level"); + } + else + { + Console.WriteLine("Player5 didnt move to the next level"); + } + } + } +} diff --git a/Set1Task6/Set1Task6.csproj b/Set1Task6/Set1Task6.csproj new file mode 100644 index 0000000..2082704 --- /dev/null +++ b/Set1Task6/Set1Task6.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + +