From 1e9d6a541a46b1b7ebe631d74c8e0856b9b7f655 Mon Sep 17 00:00:00 2001 From: pp Date: Fri, 31 Jan 2025 13:00:16 +0100 Subject: [PATCH] Add project files. --- Torpedo.sln | 25 ++++++++++ Torpedo/App.config | 6 +++ Torpedo/Program.cs | 17 +++++++ Torpedo/Properties/AssemblyInfo.cs | 33 +++++++++++++ Torpedo/Torpedo.csproj | 54 ++++++++++++++++++++++ Torpedo/TorpedoJatek.cs | 74 ++++++++++++++++++++++++++++++ 6 files changed, 209 insertions(+) create mode 100644 Torpedo.sln create mode 100644 Torpedo/App.config create mode 100644 Torpedo/Program.cs create mode 100644 Torpedo/Properties/AssemblyInfo.cs create mode 100644 Torpedo/Torpedo.csproj create mode 100644 Torpedo/TorpedoJatek.cs diff --git a/Torpedo.sln b/Torpedo.sln new file mode 100644 index 0000000..f466a50 --- /dev/null +++ b/Torpedo.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35222.181 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Torpedo", "Torpedo\Torpedo.csproj", "{A5171321-F77F-4A9F-935F-04A0F94646DF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A5171321-F77F-4A9F-935F-04A0F94646DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5171321-F77F-4A9F-935F-04A0F94646DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5171321-F77F-4A9F-935F-04A0F94646DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5171321-F77F-4A9F-935F-04A0F94646DF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E5A1DCFD-449F-4E11-A0E9-6FED192031EE} + EndGlobalSection +EndGlobal diff --git a/Torpedo/App.config b/Torpedo/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Torpedo/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Torpedo/Program.cs b/Torpedo/Program.cs new file mode 100644 index 0000000..d515987 --- /dev/null +++ b/Torpedo/Program.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Torpedo +{ + internal class Program + { + static void Main(string[] args) + { + TorpedoJatek jatek = new TorpedoJatek(18); + jatek.Indul(); + } + } +} diff --git a/Torpedo/Properties/AssemblyInfo.cs b/Torpedo/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c3b55c0 --- /dev/null +++ b/Torpedo/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +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("Torpedo")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Torpedo")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[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("a5171321-f77f-4a9f-935f-04a0f94646df")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Torpedo/Torpedo.csproj b/Torpedo/Torpedo.csproj new file mode 100644 index 0000000..7f69fcc --- /dev/null +++ b/Torpedo/Torpedo.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {A5171321-F77F-4A9F-935F-04A0F94646DF} + Exe + Torpedo + Torpedo + 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/Torpedo/TorpedoJatek.cs b/Torpedo/TorpedoJatek.cs new file mode 100644 index 0000000..adc2b6f --- /dev/null +++ b/Torpedo/TorpedoJatek.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Torpedo +{ + internal class TorpedoJatek + { + public int Meret { get; set; } + public int HajoMeret { get; set; } + public char[,] Jatekmezo { get; set; } + public int[] HajoHelye { get; set; } + + public TorpedoJatek(int meret) + { + Meret = meret; + Jatekmezo = new char[meret, meret]; + MezotGeneral(); + HajoMeret = 3; + KifutAHajo(); + } + + private void KifutAHajo() + { + Random rd = new Random(); + int sor = rd.Next(Meret); + int oszlop = rd.Next(Meret-HajoMeret+1); + HajoHelye = new int[2]; + HajoHelye[0] = sor; + HajoHelye[1] = oszlop; + } + + private void MezotGeneral() + { + for (int sor = 0; sor < Meret; sor++) + { + for (int oszlop = 0; oszlop < Meret; oszlop++) + { + Jatekmezo[sor, oszlop] = '~'; + } + } + } + + public void Indul() + { + while (true) + { + MezoRajzol(); + Console.WriteLine("Lőjjél! pl.: F3"); + string loves = Console.ReadLine(); + + } + + } + + private void MezoRajzol() + { + Console.Write(" "); + for(int o = 0; o