Add project files.

This commit is contained in:
István Priskin 2025-01-31 13:00:16 +01:00
parent 7248594273
commit 1e9d6a541a
6 changed files with 209 additions and 0 deletions

25
Torpedo.sln Normal file
View File

@ -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

6
Torpedo/App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

17
Torpedo/Program.cs Normal file
View File

@ -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();
}
}
}

View File

@ -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")]

54
Torpedo/Torpedo.csproj Normal file
View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A5171321-F77F-4A9F-935F-04A0F94646DF}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Torpedo</RootNamespace>
<AssemblyName>Torpedo</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TorpedoJatek.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

74
Torpedo/TorpedoJatek.cs Normal file
View File

@ -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<Meret; o++) {
Console.Write((char)('A'+o));
}
for (int sor = 0; sor < Meret; sor++)
{
Console.Write("\n{0:00}",(sor + 1));
for (int oszlop = 0; oszlop < Meret; oszlop++)
{
Console.Write(Jatekmezo[sor, oszlop]);
}
}
}
}
}