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 dc8c3aa..1cfff87 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 4eaff4d..d430344 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/6005b305-6f6f-4f98-9cc9-fc0ab032f05c.vsidx b/fordulo_2/Program/.vs/Program/FileContentIndex/6005b305-6f6f-4f98-9cc9-fc0ab032f05c.vsidx new file mode 100644 index 0000000..ffdb884 Binary files /dev/null and b/fordulo_2/Program/.vs/Program/FileContentIndex/6005b305-6f6f-4f98-9cc9-fc0ab032f05c.vsidx differ diff --git a/fordulo_2/Program/.vs/Program/FileContentIndex/66d84bd2-d22e-4640-8b42-20558c6d9e13.vsidx b/fordulo_2/Program/.vs/Program/FileContentIndex/66d84bd2-d22e-4640-8b42-20558c6d9e13.vsidx deleted file mode 100644 index 36122d5..0000000 Binary files a/fordulo_2/Program/.vs/Program/FileContentIndex/66d84bd2-d22e-4640-8b42-20558c6d9e13.vsidx and /dev/null differ diff --git a/fordulo_2/Program/.vs/Program/copilot-chat/f9c248b7/sessions/2c80cc51-69dc-46bf-8377-4bdbf151902b b/fordulo_2/Program/.vs/Program/copilot-chat/f9c248b7/sessions/2c80cc51-69dc-46bf-8377-4bdbf151902b index cfa8bb8..ca3d6d4 100644 Binary files a/fordulo_2/Program/.vs/Program/copilot-chat/f9c248b7/sessions/2c80cc51-69dc-46bf-8377-4bdbf151902b and b/fordulo_2/Program/.vs/Program/copilot-chat/f9c248b7/sessions/2c80cc51-69dc-46bf-8377-4bdbf151902b differ diff --git a/fordulo_2/Program/.vs/Program/v17/.suo b/fordulo_2/Program/.vs/Program/v17/.suo index 301c0c7..4ba7563 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 d08ffda..d5d1d46 100644 --- a/fordulo_2/Program/.vs/Program/v17/DocumentLayout.backup.json +++ b/fordulo_2/Program/.vs/Program/v17/DocumentLayout.backup.json @@ -18,8 +18,21 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 1, + "SelectedChildIndex": 0, "Children": [ + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "Program.cs", + "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", + "RelativeDocumentMoniker": "Program.cs", + "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", + "RelativeToolTip": "Program.cs", + "ViewState": "AgIAAKIAAAAAAAAAAAAuwMYAAAAqAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-03-05T11:40:10.358Z", + "EditorCaption": "" + }, { "$type": "Document", "DocumentIndex": 1, @@ -30,21 +43,7 @@ "RelativeToolTip": "Jatekos.cs", "ViewState": "AgIAAAUAAAAAAAAAAAAAABAAAAAPAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-03-05T17:40:39.379Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 0, - "Title": "Program.cs", - "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", - "RelativeDocumentMoniker": "Program.cs", - "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", - "RelativeToolTip": "Program.cs", - "ViewState": "AgIAAFAAAAAAAAAAAAAuwH4AAAANAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-03-05T11:40:10.358Z", - "EditorCaption": "" + "WhenOpened": "2025-03-05T17:40:39.379Z" } ] } diff --git a/fordulo_2/Program/.vs/Program/v17/DocumentLayout.json b/fordulo_2/Program/.vs/Program/v17/DocumentLayout.json index c0c8349..d5d1d46 100644 --- a/fordulo_2/Program/.vs/Program/v17/DocumentLayout.json +++ b/fordulo_2/Program/.vs/Program/v17/DocumentLayout.json @@ -18,8 +18,21 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 1, + "SelectedChildIndex": 0, "Children": [ + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "Program.cs", + "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", + "RelativeDocumentMoniker": "Program.cs", + "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", + "RelativeToolTip": "Program.cs", + "ViewState": "AgIAAKIAAAAAAAAAAAAuwMYAAAAqAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-03-05T11:40:10.358Z", + "EditorCaption": "" + }, { "$type": "Document", "DocumentIndex": 1, @@ -30,21 +43,7 @@ "RelativeToolTip": "Jatekos.cs", "ViewState": "AgIAAAUAAAAAAAAAAAAAABAAAAAPAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-03-05T17:40:39.379Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 0, - "Title": "Program.cs", - "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", - "RelativeDocumentMoniker": "Program.cs", - "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs", - "RelativeToolTip": "Program.cs", - "ViewState": "AgIAAFAAAAAAAAAAAAAuwH4AAAAMAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-03-05T11:40:10.358Z", - "EditorCaption": "" + "WhenOpened": "2025-03-05T17:40:39.379Z" } ] } diff --git a/fordulo_2/Program/Program.cs b/fordulo_2/Program/Program.cs index 2f63b95..3dcd396 100644 --- a/fordulo_2/Program/Program.cs +++ b/fordulo_2/Program/Program.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Program @@ -123,9 +124,98 @@ namespace Program } - Console.WriteLine(new string(solvedCharsForFeladatB.ToArray())); - + Console.WriteLine($"B feladat megoldás: {new string(solvedCharsForFeladatB.ToArray())}"); + + + // c feladat + string atirando = "EZTKELLATIRNI"; + string pathToSzavak = @"..\..\..\Sources\szavak.txt"; + + var szavak = File.ReadAllLines(pathToSzavak); + + Dictionary<int, char> reversedLookUpTable = new Dictionary<int, char>(); + reversedLookUpTable.Add(0, 'A'); + reversedLookUpTable.Add(1, 'E'); + reversedLookUpTable.Add(2, 'I'); + reversedLookUpTable.Add(3, 'O'); + reversedLookUpTable.Add(4, 'U'); + + List<char> titkositottKarakterek = new List<char>(); + + foreach (char c in atirando) + { + for (int row = 0; row < tablazat.GetLength(0); row++) + { + for (int col = 0; col < tablazat.GetLength(1); col++) + { + if (tablazat[row, col] == c) + { + titkositottKarakterek.Add(reversedLookUpTable[row]); + titkositottKarakterek.Add(reversedLookUpTable[col]); + } + } + } + } + + string feladatCString = new string(titkositottKarakterek.ToArray()); + Console.WriteLine(feladatCString); + + foreach (var item in szavak) + { + Console.WriteLine(item); + } + + List<string> feladatCMegoldas = new List<string>(); + + for (int i = 0; i < feladatCString.Length; i+=2) + { + char firstChar = feladatCString[i]; + char secondChar = feladatCString[i + 1]; + + string pattern; + if (firstChar == secondChar) + { + pattern = $@"^(?=.*{firstChar}.*{firstChar}).*{firstChar}.*{firstChar}.*$"; + } + else + { + pattern = $@"^(?!.*{firstChar}.*{firstChar})(?!.*{secondChar}.*{secondChar}).*{firstChar}.*{secondChar}.*$"; + } + Regex regex = new Regex(pattern); + + foreach (string szo in szavak) + { + if (regex.IsMatch(szo)) + { + feladatCMegoldas.Add(szo); + //Console.WriteLine($"{firstChar} - {secondChar} - {szo}"); + break; + } + } + } + + foreach (var item in feladatCMegoldas) + { + Console.Write(item + " "); + } + Console.WriteLine(); + + //Ellenőrzés a kapott kódra + /* + List<char> solvedCharsForFeladatC = new List<char>(); + for (int i = 0; i < feladatCString.Length; i += 2) + { + int row = lookUpTable[feladatCString[i]]; + int col = lookUpTable[feladatCString[i + 1]]; + + solvedCharsForFeladatC.Add(tablazat[row, col]); + + } + + Console.WriteLine( new string(solvedCharsForFeladatC.ToArray())); + */ + } diff --git a/fordulo_2/Program/bin/Debug/Program.exe b/fordulo_2/Program/bin/Debug/Program.exe index 9b3d035..6c92899 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 2ff27ae..bc82255 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 9b3d035..6c92899 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 2ff27ae..bc82255 100644 Binary files a/fordulo_2/Program/obj/Debug/Program.pdb and b/fordulo_2/Program/obj/Debug/Program.pdb differ diff --git a/fordulo_2/Sources/szavak.txt b/fordulo_2/Sources/szavak.txt new file mode 100644 index 0000000..c2d51d3 --- /dev/null +++ b/fordulo_2/Sources/szavak.txt @@ -0,0 +1,25 @@ +ADVENT +APU +LERAK +TULTESZ +KUVIK +KEZES +LETOR +LETUD +MIATT +SIET +HAZA +KICSI +BIZONY +PIRUL +CSODA +SOSEM +AMIG +KARMOL +TOVIG +TOROL +ORRUK +KUBA +KUPOS +KEFIR +FUTYUL diff --git a/fordulo_2/Sources/szoveg3.txt b/fordulo_2/Sources/szoveg3.txt new file mode 100644 index 0000000..638acd3 --- /dev/null +++ b/fordulo_2/Sources/szoveg3.txt @@ -0,0 +1 @@ +EZTKELLATIRNI diff --git a/megoldasok.md b/megoldasok.md index 00c065b..13da1ac 100644 --- a/megoldasok.md +++ b/megoldasok.md @@ -35,4 +35,4 @@ ### 3. feladat - a: `213` - b: `KULDJPENZT` -- c: `` +- c: `APU FUTYUL ORRUK MIATT APU SIET SIET HAZA ORRUK LETOR TOVIG BIZONY LETOR`