oszto12B/Oszto/Oszto.cs

55 lines
1.4 KiB
C#
Raw Normal View History

2023-09-12 10:52:15 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Oszto
{
class Oszto
{
2023-09-14 12:58:52 +00:00
public Pakli Csomag;
public Jatekos[] Jatekosok;
public int Kezbedb;
public int Hanyasaval;
2023-09-12 10:52:15 +00:00
static void Main(string[] args)
{
Console.WriteLine("Osztó program OOP");
2023-09-14 12:58:52 +00:00
//Pakli pakli = new Pakli();
2023-09-19 10:53:18 +00:00
Oszto progi = new Oszto();
progi.Kioszt();
}
public void Kioszt()
{
Bekeres();
}
private bool Ellenorzes()
{
return (Kezbedb * Jatekosok.Length <= 52) && (Kezbedb % Hanyasaval == 0);
2023-09-14 12:58:52 +00:00
}
private void Bekeres()
{
2023-09-19 10:53:18 +00:00
Console.Write("Hány játékos lesz?: ");
int jdb = int.Parse(Console.ReadLine());
//int jdb = Convert.ToInt32(Console.ReadLine());
Console.Write("Hány lapot kapnak?: ");
Kezbedb = int.Parse(Console.ReadLine());
Console.Write("Az osztáskor hanyasával adjuk a lapokat?: ");
Kezbedb = int.Parse(Console.ReadLine());
2023-09-14 12:58:52 +00:00
2023-09-19 10:53:18 +00:00
//a játékosok tömbjének létrehozása
Jatekosok = new Jatekos[jdb];
for (int i = 0; i < jdb; i++)
{
Jatekosok[i] = new Jatekos("Player-" + i);
}
2023-09-12 10:52:15 +00:00
}
}
}