Jatekos kesz

This commit is contained in:
István Priskin 2023-09-14 14:58:52 +02:00
parent 189fa11357
commit 44a2d65d89
4 changed files with 63 additions and 1 deletions

29
Oszto/Jatekos.cs Normal file
View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Oszto
{
class Jatekos
{
public Kartyalap[] lapok;
public string nev;
public Jatekos(string nev)
{
this.nev = nev;
}
public void terit()
{
Console.WriteLine(nev);
foreach (var item in lapok)
{
Console.WriteLine(item);
}
}
}
}

View File

@ -8,10 +8,21 @@ namespace Oszto
{
class Oszto
{
public Pakli Csomag;
public Jatekos[] Jatekosok;
public int Kezbedb;
public int Hanyasaval;
static void Main(string[] args)
{
Console.WriteLine("Osztó program OOP");
Pakli pakli = new Pakli();
//Pakli pakli = new Pakli();
}
private void Bekeres()
{
}
}
}

View File

@ -43,6 +43,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Jatekos.cs" />
<Compile Include="Kartyalap.cs" />
<Compile Include="Oszto.cs" />
<Compile Include="Pakli.cs" />

View File

@ -35,7 +35,28 @@ namespace Oszto
private void kever()
{
//pakli előtte
//foreach (var item in lapok)
//{
// Console.WriteLine(item);
//}
Random rd = new Random();
for (int i = 0; i < 500; i++)
{
int egyik = rd.Next(0, 52);
int masik = rd.Next(0, 52);
if (egyik!=masik)
{
Kartyalap tmp = lapok[egyik];
lapok[egyik] = lapok[masik];
lapok[masik] = tmp;
}
}
//Console.WriteLine("pakli utána");
/* foreach (var item in lapok)
{
Console.WriteLine(item);
}*/
}
}