diff --git a/Oszto/Csomag.cs b/Oszto/Csomag.cs new file mode 100644 index 0000000..81f3acb --- /dev/null +++ b/Oszto/Csomag.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Oszto +{ + class Csomag + { + public static readonly string[] frszinek = { "pikk", "kőr", "káró", "treff" }; + public static readonly string[] frertekek = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "D", "K", "A" }; + + public Kartyalap[] lapok; + + + public Csomag() + { + lapok = new Kartyalap[52]; + int lit = 0; + for (int i = 0; i < frszinek.Length; i++) + { + for (int j = 0; j < frertekek.Length; j++) + { + lapok[lit] = new Kartyalap(frszinek[i], frertekek[j]); + lit++; + //lapok[i*13+j] = new .... + } + } + + /*foreach (var item in lapok) + { + Console.WriteLine(item.szin+"-"+item.ertek); + }*/ + } + + public void kever() + { + Random rd = new Random(); + for (int i = 0; i < 500; i++) + { + int n1 = rd.Next(0, 51); + int n2 = rd.Next(0, 51); + if(n1!=n2) + { + Kartyalap temp = lapok[n1]; + lapok[n1] = lapok[n2]; + lapok[n2] = temp; + } + } + foreach (var item in lapok) + { + Console.WriteLine(item.szin+"-"+item.ertek); + } + } + + + } +} diff --git a/Oszto/Kartyalap.cs b/Oszto/Kartyalap.cs new file mode 100644 index 0000000..f6c9120 --- /dev/null +++ b/Oszto/Kartyalap.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Oszto +{ + class Kartyalap + { + public string szin; + public string ertek; + + public Kartyalap() + { + szin = "nincs"; + ertek = "nincs"; + } + + public Kartyalap(String szin, String ertek) + { + this.szin = szin; + this.ertek = ertek; + } + + + } +} diff --git a/Oszto/Oszto.csproj b/Oszto/Oszto.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Oszto/Oszto.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git a/Oszto/Program.cs b/Oszto/Program.cs new file mode 100644 index 0000000..c6b3768 --- /dev/null +++ b/Oszto/Program.cs @@ -0,0 +1,13 @@ +using System; + +namespace Oszto +{ + class Program + { + static void Main(string[] args) + { + Csomag pakli = new Csomag(); + pakli.kever(); + } + } +} diff --git a/SzotarFeladatok.sln b/SzotarFeladatok.sln index 29cb00f..f642bdf 100644 --- a/SzotarFeladatok.sln +++ b/SzotarFeladatok.sln @@ -5,7 +5,9 @@ VisualStudioVersion = 16.0.31624.102 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Szotar", "Szotar\Szotar.csproj", "{8465ADED-61C4-4EB2-A42C-C47B86DC42B5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Valasztasok", "Valasztasok\Valasztasok.csproj", "{F70CD600-1632-4FB5-8DC0-BDD9DDF70248}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Valasztasok", "Valasztasok\Valasztasok.csproj", "{F70CD600-1632-4FB5-8DC0-BDD9DDF70248}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Oszto", "Oszto\Oszto.csproj", "{CCBC99D9-3207-4B83-80B7-382E0CE0E748}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,10 @@ Global {F70CD600-1632-4FB5-8DC0-BDD9DDF70248}.Debug|Any CPU.Build.0 = Debug|Any CPU {F70CD600-1632-4FB5-8DC0-BDD9DDF70248}.Release|Any CPU.ActiveCfg = Release|Any CPU {F70CD600-1632-4FB5-8DC0-BDD9DDF70248}.Release|Any CPU.Build.0 = Release|Any CPU + {CCBC99D9-3207-4B83-80B7-382E0CE0E748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CCBC99D9-3207-4B83-80B7-382E0CE0E748}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CCBC99D9-3207-4B83-80B7-382E0CE0E748}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CCBC99D9-3207-4B83-80B7-382E0CE0E748}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE