diff --git a/.vs/c-sharp/project-colors.json b/.vs/c-sharp/project-colors.json new file mode 100644 index 0000000..28e40bc --- /dev/null +++ b/.vs/c-sharp/project-colors.json @@ -0,0 +1,16 @@ +{ + "Version": 1, + "ProjectMap": { + "a6876a09-53d2-47af-a648-81bad791d19d": { + "ProjectGuid": "a6876a09-53d2-47af-a648-81bad791d19d", + "DisplayName": "c-sharp", + "ColorIndex": 0 + }, + "b1ffc5c5-05eb-454b-bc64-505e246ca686": { + "ProjectGuid": "b1ffc5c5-05eb-454b-bc64-505e246ca686", + "DisplayName": "Szamkitalalo", + "ColorIndex": 1 + } + }, + "NextColorIndex": 2 +} \ No newline at end of file diff --git a/.vs/c-sharp/v16/.suo b/.vs/c-sharp/v16/.suo index a1dc8dc..0caa0b5 100644 Binary files a/.vs/c-sharp/v16/.suo and b/.vs/c-sharp/v16/.suo differ diff --git a/.vs/c-sharp/v17/.suo b/.vs/c-sharp/v17/.suo new file mode 100644 index 0000000..ed289d8 Binary files /dev/null and b/.vs/c-sharp/v17/.suo differ diff --git a/Szamkitalalo/App.config b/Szamkitalalo/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Szamkitalalo/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Szamkitalalo/Program.cs b/Szamkitalalo/Program.cs new file mode 100644 index 0000000..d556fda --- /dev/null +++ b/Szamkitalalo/Program.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Szamkitalalo { + class Program { + static void Main(string[] args) { + Random random = new Random(); + short pc_random = (short)random.Next(1, 100); + short user_random = 0; + short tipp_counter = 0; + bool isFelhasznalo = false; + + Console.WriteLine("Játékos vagy gép tippel? Ha jatekos irj 1-et"); + short valasztas = Convert.ToInt16(Console.ReadLine()); + if(valasztas == 1) { + isFelhasznalo = true; + } + + while (tipp_counter < 5) { + if (isFelhasznalo) { + while (tipp_counter < 5) { + tipp_counter++; + Console.WriteLine("Tippelj (1-100)"); + short user_tipp = Convert.ToInt16(Console.ReadLine()); + + if (pc_random > user_tipp) { + Console.WriteLine("Tul kicsi a tipp"); + } else if (pc_random < user_tipp) { + Console.WriteLine("Tul nagy a tipp"); + } else if (pc_random == user_tipp) { + Console.WriteLine("Nyertel"); + Console.WriteLine("PC tippje: {0}", pc_random); + break; + } + if(tipp_counter == 5) { + Console.WriteLine("PC tippje: {0}",pc_random); + } + } + } else { + Console.WriteLine("Irj be egy szamot (1-100)"); + user_random = Convert.ToInt16(Console.ReadLine()); + short rand_min = 1; + short rand_max = 100; + + while (user_random != pc_random) { + tipp_counter++; + pc_random = (short)random.Next(rand_min, rand_max); + Console.WriteLine("PC tipp {0}", pc_random); + if (pc_random < user_random) { + Console.WriteLine("Tul kicsi a tipp"); + rand_min += 10; + if(rand_min > user_random) { + rand_min = user_random; + } + } else if (pc_random > user_random) { + Console.WriteLine("Tul nagy a tipp"); + rand_max -= 10; + if(rand_max < user_random) { + rand_max = user_random; + } + } else if (pc_random == user_random) { + Console.WriteLine("PC nyert"); + Console.WriteLine("Felhasznalo tippje: {0}", user_random); + break; + } + } + } + } + + Console.ReadKey(); + } + } +} diff --git a/Szamkitalalo/Properties/AssemblyInfo.cs b/Szamkitalalo/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..34cec35 --- /dev/null +++ b/Szamkitalalo/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Szamkitalalo")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Szamkitalalo")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b1ffc5c5-05eb-454b-bc64-505e246ca686")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Szamkitalalo/Szamkitalalo.csproj b/Szamkitalalo/Szamkitalalo.csproj new file mode 100644 index 0000000..25fd64f --- /dev/null +++ b/Szamkitalalo/Szamkitalalo.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {B1FFC5C5-05EB-454B-BC64-505E246CA686} + Exe + Szamkitalalo + Szamkitalalo + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Szamkitalalo/bin/Debug/Szamkitalalo.exe b/Szamkitalalo/bin/Debug/Szamkitalalo.exe new file mode 100644 index 0000000..0b866ca Binary files /dev/null and b/Szamkitalalo/bin/Debug/Szamkitalalo.exe differ diff --git a/Szamkitalalo/bin/Debug/Szamkitalalo.exe.config b/Szamkitalalo/bin/Debug/Szamkitalalo.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Szamkitalalo/bin/Debug/Szamkitalalo.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Szamkitalalo/bin/Debug/Szamkitalalo.pdb b/Szamkitalalo/bin/Debug/Szamkitalalo.pdb new file mode 100644 index 0000000..15e947b Binary files /dev/null and b/Szamkitalalo/bin/Debug/Szamkitalalo.pdb differ diff --git a/Szamkitalalo/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Szamkitalalo/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Szamkitalalo/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Szamkitalalo/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Szamkitalalo/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..529f191 Binary files /dev/null and b/Szamkitalalo/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.AssemblyReference.cache b/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.AssemblyReference.cache new file mode 100644 index 0000000..0da8ef2 Binary files /dev/null and b/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.AssemblyReference.cache differ diff --git a/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.CoreCompileInputs.cache b/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..ee191d7 --- /dev/null +++ b/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +7f4b213b428f4c013f19137338418ee1f5525793 diff --git a/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.FileListAbsolute.txt b/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..b41e68a --- /dev/null +++ b/Szamkitalalo/obj/Debug/Szamkitalalo.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +C:\dev\c#\c-sharp\Szamkitalalo\obj\Debug\Szamkitalalo.csproj.AssemblyReference.cache +C:\dev\c#\c-sharp\Szamkitalalo\obj\Debug\Szamkitalalo.csproj.CoreCompileInputs.cache +C:\dev\c#\c-sharp\Szamkitalalo\bin\Debug\Szamkitalalo.exe.config +C:\dev\c#\c-sharp\Szamkitalalo\bin\Debug\Szamkitalalo.exe +C:\dev\c#\c-sharp\Szamkitalalo\bin\Debug\Szamkitalalo.pdb +C:\dev\c#\c-sharp\Szamkitalalo\obj\Debug\Szamkitalalo.exe +C:\dev\c#\c-sharp\Szamkitalalo\obj\Debug\Szamkitalalo.pdb diff --git a/Szamkitalalo/obj/Debug/Szamkitalalo.exe b/Szamkitalalo/obj/Debug/Szamkitalalo.exe new file mode 100644 index 0000000..0b866ca Binary files /dev/null and b/Szamkitalalo/obj/Debug/Szamkitalalo.exe differ diff --git a/Szamkitalalo/obj/Debug/Szamkitalalo.pdb b/Szamkitalalo/obj/Debug/Szamkitalalo.pdb new file mode 100644 index 0000000..15e947b Binary files /dev/null and b/Szamkitalalo/obj/Debug/Szamkitalalo.pdb differ diff --git a/c-sharp.sln b/c-sharp.sln index 76857d8..5a87778 100644 --- a/c-sharp.sln +++ b/c-sharp.sln @@ -1,10 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31911.196 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32112.339 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "c-sharp", "c-sharp\c-sharp.csproj", "{A6876A09-53D2-47AF-A648-81BAD791D19D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Szamkitalalo", "Szamkitalalo\Szamkitalalo.csproj", "{B1FFC5C5-05EB-454B-BC64-505E246CA686}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {A6876A09-53D2-47AF-A648-81BAD791D19D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A6876A09-53D2-47AF-A648-81BAD791D19D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A6876A09-53D2-47AF-A648-81BAD791D19D}.Release|Any CPU.Build.0 = Release|Any CPU + {B1FFC5C5-05EB-454B-BC64-505E246CA686}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1FFC5C5-05EB-454B-BC64-505E246CA686}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1FFC5C5-05EB-454B-BC64-505E246CA686}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1FFC5C5-05EB-454B-BC64-505E246CA686}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/c-sharp/Program.cs b/c-sharp/Program.cs index 25cf2fd..41d3e61 100644 --- a/c-sharp/Program.cs +++ b/c-sharp/Program.cs @@ -10,6 +10,32 @@ namespace c_sharp { static void Main(string[] args) { + string folytatas = "igen"; + string[] opciok = { "ko", "papir", "ollo" }; + + while (folytatas == "igen") { + Random random = new Random(); + int pc_random = random.Next(0, 2); + string pc_valasztas = opciok[pc_random]; + + string user_valsztas = Console.ReadLine(); + + Console.WriteLine("PC: {0}",pc_valasztas); + + if (pc_valasztas == "ko" && user_valsztas == "ko") { Console.WriteLine("Dontetlen"); } + else if (pc_valasztas == "ko" && user_valsztas == "papir") { Console.WriteLine("Vesztettel"); } + else if (pc_valasztas == "ko" && user_valsztas == "ollo") { Console.WriteLine("Nyertel"); } + else if (pc_valasztas == "papir" && user_valsztas == "ko") { Console.WriteLine("Vesztettel"); } + else if (pc_valasztas == "papir" && user_valsztas == "papir") { Console.WriteLine("Dontetlen"); } + else if (pc_valasztas == "papir" && user_valsztas == "ollo") { Console.WriteLine("Nyertel"); } + else if (pc_valasztas == "ollo" && user_valsztas == "ko") { Console.WriteLine("Nyertel"); } + else if (pc_valasztas == "ollo" && user_valsztas == "papir") { Console.WriteLine("Vesztettel"); } + else if (pc_valasztas == "ollo" && user_valsztas == "ollo") { Console.WriteLine("Dontetlen"); } + else { Console.WriteLine("Hiba"); } + + Console.WriteLine("Akarsz meg jatszani? (igen/nem)"); + folytatas = Console.ReadLine(); + } } } } diff --git a/c-sharp/bin/Debug/c-sharp.exe b/c-sharp/bin/Debug/c-sharp.exe new file mode 100644 index 0000000..1519a9b Binary files /dev/null and b/c-sharp/bin/Debug/c-sharp.exe differ diff --git a/c-sharp/bin/Debug/c-sharp.exe.config b/c-sharp/bin/Debug/c-sharp.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/c-sharp/bin/Debug/c-sharp.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/c-sharp/bin/Debug/c-sharp.pdb b/c-sharp/bin/Debug/c-sharp.pdb new file mode 100644 index 0000000..5d635c6 Binary files /dev/null and b/c-sharp/bin/Debug/c-sharp.pdb differ diff --git a/c-sharp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/c-sharp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 84e30cd..2a7adbf 100644 Binary files a/c-sharp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/c-sharp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/c-sharp/obj/Debug/c-sharp.csproj.AssemblyReference.cache b/c-sharp/obj/Debug/c-sharp.csproj.AssemblyReference.cache index 4eb356a..0da8ef2 100644 Binary files a/c-sharp/obj/Debug/c-sharp.csproj.AssemblyReference.cache and b/c-sharp/obj/Debug/c-sharp.csproj.AssemblyReference.cache differ diff --git a/c-sharp/obj/Debug/c-sharp.csproj.CoreCompileInputs.cache b/c-sharp/obj/Debug/c-sharp.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..ee191d7 --- /dev/null +++ b/c-sharp/obj/Debug/c-sharp.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +7f4b213b428f4c013f19137338418ee1f5525793 diff --git a/c-sharp/obj/Debug/c-sharp.csproj.FileListAbsolute.txt b/c-sharp/obj/Debug/c-sharp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..2375fc5 --- /dev/null +++ b/c-sharp/obj/Debug/c-sharp.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +C:\dev\c#\c-sharp\c-sharp\bin\Debug\c-sharp.exe.config +C:\dev\c#\c-sharp\c-sharp\bin\Debug\c-sharp.exe +C:\dev\c#\c-sharp\c-sharp\bin\Debug\c-sharp.pdb +C:\dev\c#\c-sharp\c-sharp\obj\Debug\c-sharp.csproj.AssemblyReference.cache +C:\dev\c#\c-sharp\c-sharp\obj\Debug\c-sharp.csproj.CoreCompileInputs.cache +C:\dev\c#\c-sharp\c-sharp\obj\Debug\c-sharp.exe +C:\dev\c#\c-sharp\c-sharp\obj\Debug\c-sharp.pdb diff --git a/c-sharp/obj/Debug/c-sharp.exe b/c-sharp/obj/Debug/c-sharp.exe new file mode 100644 index 0000000..1519a9b Binary files /dev/null and b/c-sharp/obj/Debug/c-sharp.exe differ diff --git a/c-sharp/obj/Debug/c-sharp.pdb b/c-sharp/obj/Debug/c-sharp.pdb new file mode 100644 index 0000000..5d635c6 Binary files /dev/null and b/c-sharp/obj/Debug/c-sharp.pdb differ