diff --git a/fordulo_2/Program/.vs/Program/CopilotIndices/17.13.431.34963/CodeChunks.db b/fordulo_2/Program/.vs/Program/CopilotIndices/17.13.431.34963/CodeChunks.db index 10fe534..e4b124b 100644 Binary files a/fordulo_2/Program/.vs/Program/CopilotIndices/17.13.431.34963/CodeChunks.db and b/fordulo_2/Program/.vs/Program/CopilotIndices/17.13.431.34963/CodeChunks.db differ diff --git a/fordulo_2/Program/.vs/Program/CopilotIndices/17.13.431.34963/SemanticSymbols.db b/fordulo_2/Program/.vs/Program/CopilotIndices/17.13.431.34963/SemanticSymbols.db index 437eb7f..6474ccc 100644 Binary files a/fordulo_2/Program/.vs/Program/CopilotIndices/17.13.431.34963/SemanticSymbols.db and b/fordulo_2/Program/.vs/Program/CopilotIndices/17.13.431.34963/SemanticSymbols.db differ diff --git a/fordulo_2/Program/.vs/Program/FileContentIndex/10306f20-1903-4ad6-83dd-f8e302ec3180.vsidx b/fordulo_2/Program/.vs/Program/FileContentIndex/10306f20-1903-4ad6-83dd-f8e302ec3180.vsidx deleted file mode 100644 index 991e5ac..0000000 Binary files a/fordulo_2/Program/.vs/Program/FileContentIndex/10306f20-1903-4ad6-83dd-f8e302ec3180.vsidx and /dev/null differ diff --git a/fordulo_2/Program/.vs/Program/FileContentIndex/6893f8c3-8ee9-4562-aeb0-3800d3539bee.vsidx b/fordulo_2/Program/.vs/Program/FileContentIndex/6893f8c3-8ee9-4562-aeb0-3800d3539bee.vsidx new file mode 100644 index 0000000..782caa1 Binary files /dev/null and b/fordulo_2/Program/.vs/Program/FileContentIndex/6893f8c3-8ee9-4562-aeb0-3800d3539bee.vsidx differ diff --git a/fordulo_2/Program/.vs/Program/FileContentIndex/c3d66a48-e0b6-40c3-bbec-fa0b7a0d8129.vsidx b/fordulo_2/Program/.vs/Program/FileContentIndex/c3d66a48-e0b6-40c3-bbec-fa0b7a0d8129.vsidx deleted file mode 100644 index 8591452..0000000 Binary files a/fordulo_2/Program/.vs/Program/FileContentIndex/c3d66a48-e0b6-40c3-bbec-fa0b7a0d8129.vsidx and /dev/null differ diff --git a/fordulo_2/Program/.vs/Program/FileContentIndex/e06ac909-7382-4c50-8c8f-de899b80d8ab.vsidx b/fordulo_2/Program/.vs/Program/FileContentIndex/e06ac909-7382-4c50-8c8f-de899b80d8ab.vsidx new file mode 100644 index 0000000..83b0654 Binary files /dev/null and b/fordulo_2/Program/.vs/Program/FileContentIndex/e06ac909-7382-4c50-8c8f-de899b80d8ab.vsidx differ diff --git a/fordulo_2/Program/.vs/Program/copilot-chat/f9c248b7/sessions/8333691a-c297-47ca-b35b-41e3eba3f8ed b/fordulo_2/Program/.vs/Program/copilot-chat/f9c248b7/sessions/8333691a-c297-47ca-b35b-41e3eba3f8ed deleted file mode 100644 index e3b1c22..0000000 Binary files a/fordulo_2/Program/.vs/Program/copilot-chat/f9c248b7/sessions/8333691a-c297-47ca-b35b-41e3eba3f8ed and /dev/null differ diff --git a/fordulo_2/Program/.vs/Program/v17/.suo b/fordulo_2/Program/.vs/Program/v17/.suo index 2f24a06..b778d70 100644 Binary files a/fordulo_2/Program/.vs/Program/v17/.suo and b/fordulo_2/Program/.vs/Program/v17/.suo differ diff --git a/fordulo_2/Program/.vs/Program/v17/DocumentLayout.backup.json b/fordulo_2/Program/.vs/Program/v17/DocumentLayout.backup.json index 56de984..5b83ad8 100644 --- a/fordulo_2/Program/.vs/Program/v17/DocumentLayout.backup.json +++ b/fordulo_2/Program/.vs/Program/v17/DocumentLayout.backup.json @@ -9,10 +9,6 @@ { "AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\idopont.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:idopont.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" } ], "DocumentGroupContainers": [ @@ -22,7 +18,7 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 2, + "SelectedChildIndex": 1, "Children": [ { "$type": "Document", @@ -32,24 +28,11 @@ "RelativeDocumentMoniker": "Jatekos.cs", "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs", "RelativeToolTip": "Jatekos.cs", - "ViewState": "AgIAAAEAAAAAAAAAAAAiwBQAAAAAAAAAAAAAAA==", + "ViewState": "AgIAAAQAAAAAAAAAAAAiwCcAAAAvAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2025-03-05T17:40:39.379Z", "EditorCaption": "" }, - { - "$type": "Document", - "DocumentIndex": 2, - "Title": "Idopont.cs", - "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs", - "RelativeDocumentMoniker": "Idopont.cs", - "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs", - "RelativeToolTip": "Idopont.cs", - "ViewState": "AgIAAAIAAAAAAAAAAAAAwC4AAAAJAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-03-05T11:46:26.985Z", - "EditorCaption": "" - }, { "$type": "Document", "DocumentIndex": 0, @@ -58,7 +41,7 @@ "RelativeDocumentMoniker": "Program.cs", "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", "RelativeToolTip": "Program.cs", - "ViewState": "AgIAADoAAAAAAAAAAAAAAGgAAAAAAAAAAAAAAA==", + "ViewState": "AgIAAM8AAAAAAAAAAAAAAOcAAABHAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2025-03-05T11:40:10.358Z", "EditorCaption": "" diff --git a/fordulo_2/Program/.vs/Program/v17/DocumentLayout.json b/fordulo_2/Program/.vs/Program/v17/DocumentLayout.json index 3dac5d4..638ced5 100644 --- a/fordulo_2/Program/.vs/Program/v17/DocumentLayout.json +++ b/fordulo_2/Program/.vs/Program/v17/DocumentLayout.json @@ -6,10 +6,6 @@ "AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|e:\\h\u00E1zi\\13.oszt\u00E1ly\\neumann_verseny\\fordulo_2\\program\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\idopont.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:idopont.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -22,34 +18,21 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 2, + "SelectedChildIndex": 1, "Children": [ { "$type": "Document", - "DocumentIndex": 2, + "DocumentIndex": 1, "Title": "Jatekos.cs", "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs", "RelativeDocumentMoniker": "Jatekos.cs", "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs", "RelativeToolTip": "Jatekos.cs", - "ViewState": "AgIAAAEAAAAAAAAAAAAiwBQAAAAAAAAAAAAAAA==", + "ViewState": "AgIAAAQAAAAAAAAAAAAiwCcAAAAvAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2025-03-05T17:40:39.379Z", "EditorCaption": "" }, - { - "$type": "Document", - "DocumentIndex": 1, - "Title": "Idopont.cs", - "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs", - "RelativeDocumentMoniker": "Idopont.cs", - "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs", - "RelativeToolTip": "Idopont.cs", - "ViewState": "AgIAAAgAAAAAAAAAAAAAwC4AAAAJAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-03-05T11:46:26.985Z", - "EditorCaption": "" - }, { "$type": "Document", "DocumentIndex": 0, @@ -58,7 +41,7 @@ "RelativeDocumentMoniker": "Program.cs", "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", "RelativeToolTip": "Program.cs", - "ViewState": "AgIAAEMAAAAAAAAAAAAAAGkAAAANAAAAAAAAAA==", + "ViewState": "AgIAAOoAAAAAAAAAAADwv/UAAAAQAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2025-03-05T11:40:10.358Z", "EditorCaption": "" diff --git a/fordulo_2/Program/Jatekos.cs b/fordulo_2/Program/Jatekos.cs index 2333ada..028ab99 100644 --- a/fordulo_2/Program/Jatekos.cs +++ b/fordulo_2/Program/Jatekos.cs @@ -10,7 +10,24 @@ namespace Program { public string Nev { get; set; } - public int Pontszam { get; set; } + + public Minta Minta = new Minta(); + } + + class Minta + { + public bool Nagysor { get; set; } + public bool Kissor { get; set; } + public bool Poker { get; set; } + public bool Full { get; set; } + public bool Terc { get; set; } + public bool KetPar { get; set; } + public bool EgyPar { get; set; } + + public bool AllTrue() + { + return Nagysor && Kissor && Poker && Full && Terc && KetPar && EgyPar; + } } class Kor @@ -18,5 +35,8 @@ namespace Program public Jatekos jatekos { get; set; } public int[] dobasok { get; set; } + + public int[] dobasokFull { get; set; } + public int[] dontesekFull { get; set; } } } diff --git a/fordulo_2/Program/Program.cs b/fordulo_2/Program/Program.cs index 713d068..f6982f6 100644 --- a/fordulo_2/Program/Program.cs +++ b/fordulo_2/Program/Program.cs @@ -23,6 +23,10 @@ namespace Program var dobasok = new List<int>(); var dontesek = new List<int>(); + //d feladathoz + int pokermaxNum = 0; + + //dobasok var data = File.ReadAllText(path).Trim(); @@ -63,11 +67,17 @@ namespace Program int jatekosCounter = 0; + List<int> dobasokFull = new List<int>(); + List<int> dontesekFull = new List<int>(); + for (int i = 0; i < dobasok.Count; i++) { int dobas = dobasok[i]; int dontes = dontesek[i]; + dobasokFull.Add(dobas); + dontesekFull.Add(dontes); + if (dontes == 1) { dobasokSmallerScope.Add(dobas); @@ -78,6 +88,12 @@ namespace Program kor.dobasok = dobasokSmallerScope.ToArray(); kor.jatekos = jatekosok[jatekosCounter]; + kor.dobasokFull = dobasokFull.ToArray(); + kor.dontesekFull = dontesekFull.ToArray(); + + dobasokFull.Clear(); + dontesekFull.Clear(); + korok.Add(kor); dobasokSmallerScope.Clear(); @@ -89,7 +105,7 @@ namespace Program { jatekosCounter++; } - + continue; } } @@ -100,11 +116,176 @@ namespace Program Console.WriteLine($"Teljes körök száma: {korok.Count / 3}"); // b feladat - foreach (var item in korok) - { + + + foreach (var kor in korok) + { + foreach (var jatekos in jatekosok) + { + if (jatekos.Nev == kor.jatekos.Nev) + { + int[] dobasokAKorben = kor.dobasok; + + bool sorCondition = dobasokAKorben.Distinct().Count() == 5; + + //nagysor + if (sorCondition && dobasokAKorben.Contains(6)) + { + jatekos.Minta.Nagysor = true; + continue; + } + + //kissor + if (sorCondition && dobasokAKorben.Contains(1)) + { + jatekos.Minta.Kissor = true; + continue; + } + + //poker + var pokerGroup = dobasokAKorben.GroupBy(x => x).FirstOrDefault(g => g.Count() == 4); + if (pokerGroup != null) + { + int pokerValue = pokerGroup.Key; + if (pokerValue > pokermaxNum) + { + pokermaxNum = pokerValue; + } + jatekos.Minta.Poker = true; + continue; + } + + //full + if (dobasokAKorben.Count(x => x == 3) == 1 && dobasokAKorben.Count(x => x == 2) == 1) + { + jatekos.Minta.Full = true; + continue; + } + + //terc + if (dobasokAKorben.Count(x => x == 3) == 1) + { + jatekos.Minta.Terc = true; + continue; + } + + //ketpar + if (dobasokAKorben.Count(x => x == 2) == 2) + { + jatekos.Minta.KetPar = true; + continue; + } + + //egypar + if (dobasokAKorben.Count(x => x == 2) == 1) + { + jatekos.Minta.EgyPar = true; + continue; + } + } + } } + foreach (var jatekos in jatekosok) + { + if (jatekos.Minta.AllTrue()) + { + Console.WriteLine($"{jatekos.Nev} nyerte meg a játékot"); + } + } + + // c feladat + + int counter = 0; + + foreach (var kor in korok) + { + if (kor.jatekos.Nev == "Gamma") + { + int[] dobasokAKorben = kor.dobasok; + counter++; + if (dobasokAKorben.Count(x => x == 3) == 1 && dobasokAKorben.Count(x => x == 2) == 1) + { + + break; + } + } + + } + + Console.WriteLine($"Gamma ebbe a körbe dobott full-t: {counter + 1}"); + + // d feladat + + Console.WriteLine($"A legnagyobb poker értéke: {pokermaxNum}"); + + + // e feladat + foreach (var kor in korok) + { + IntArrKiir(kor.dobasokFull); + IntArrKiir(kor.dontesekFull); + Console.WriteLine("---------"); + } + + Console.WriteLine(CountPairs(new int[] { 2, 2, 3, 3, 4 })); + + + } + + + static int GetAllPairs(List<int> dobasok, List<int> dontesek) + { + int pairs = 0; + + List<int> asztalok = new List<int>(); + + foreach (var dobas in dobasok) + { + + } + + + return pairs; + } + + static int CountPairs(int[] dobasok) + { + int pairs = 0; + + //terc + if (dobasok.Count(x => x == 3) == 1) + { + return 0; + } + + var pokerGroup = dobasok.GroupBy(x => x).FirstOrDefault(g => g.Count() == 4); + if (pokerGroup != null) + { + return 0; + } + + + for (int i = 0; i < dobasok.Length; i++) + { + for (int j = i + 1; j < dobasok.Length; j++) + { + if (dobasok[i] == dobasok[j]) + { + pairs++; + } + } + } + return pairs; + } + static void IntArrKiir(int[] arr) + { + foreach (var item in arr) + { + Console.Write(item + " "); + } + Console.WriteLine(); } static void Feladat1() @@ -169,25 +350,26 @@ namespace Program int counter = 0; int iterations = 0; - int napokCounter = 0; + int napokCounter = 1; foreach (var item in idopontok2) { - if (counter == anglesToLookFor.Count) - { - break; - } - if (item.Angle == anglesToLookFor[counter]) { counter++; } + if (counter == anglesToLookFor.Count) + { + break; + } + iterations++; if (iterations == 1440) { napokCounter++; + iterations = 0; } } diff --git a/fordulo_2/Program/bin/Debug/Program.exe b/fordulo_2/Program/bin/Debug/Program.exe index 0657c91..46fffd1 100644 Binary files a/fordulo_2/Program/bin/Debug/Program.exe and b/fordulo_2/Program/bin/Debug/Program.exe differ diff --git a/fordulo_2/Program/bin/Debug/Program.pdb b/fordulo_2/Program/bin/Debug/Program.pdb index bcb1908..caed456 100644 Binary files a/fordulo_2/Program/bin/Debug/Program.pdb and b/fordulo_2/Program/bin/Debug/Program.pdb differ diff --git a/fordulo_2/Program/obj/Debug/Program.exe b/fordulo_2/Program/obj/Debug/Program.exe index 0657c91..46fffd1 100644 Binary files a/fordulo_2/Program/obj/Debug/Program.exe and b/fordulo_2/Program/obj/Debug/Program.exe differ diff --git a/fordulo_2/Program/obj/Debug/Program.pdb b/fordulo_2/Program/obj/Debug/Program.pdb index bcb1908..caed456 100644 Binary files a/fordulo_2/Program/obj/Debug/Program.pdb and b/fordulo_2/Program/obj/Debug/Program.pdb differ diff --git a/gamma b/gamma new file mode 100644 index 0000000..e4d7800 --- /dev/null +++ b/gamma @@ -0,0 +1,14 @@ +6 6 2 5 4 +4 4 4 3 4 +6 1 1 6 4 +3 3 4 2 5 +4 4 4 2 3 +4 4 6 6 6 +6 3 2 4 1 +4 1 2 5 5 +4 5 1 2 1 +2 5 6 3 6 +2 4 1 5 2 +3 4 1 2 1 +1 2 3 5 3 +1 5 3 4 6 diff --git a/megoldasok.md b/megoldasok.md index 5e457fa..a8e7b8a 100644 --- a/megoldasok.md +++ b/megoldasok.md @@ -23,12 +23,12 @@ ### 1. feladat - a: `3:49` - b: `1.5` -- c: `1|15:37` +- c: `4|15:36` ### 2. feladat - a: `14` -- b: `` -- c: `` +- b: `alfa` +- c: `1` - d: `` - e: ``