Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailem Rada ohledně části kódu c#

Hodim sem cely kod, dela mi to ruzne vylomeniny, nebyl by prosim nekdo ochotny rict mi co kde?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfApplication1
{
    class Hra
    {
        private Random Kostka = new Random();
        private int a, b, c;
        private int Hod = 0;
        private int trefcislo,penizeh1 = 100, penizeh2 = 100, z;

        public Hra()
        {

        }

        public string Kostka1
        {
            get { return Convert.ToString(a = Kostka.Next(1, 7)); }
        }
        public string Kostka2
        {
            get { return Convert.ToString(b = Kostka.Next(1, 7)); }
        }
        public string Kostka3
        {
            get { return Convert.ToString(c = Kostka.Next(1, 7)); }
        }


        public int Hody
        {

            get { return Hod++; }
        }

        public int prepinac
        {
            get
            {
                if (Hod < 1)
                    return 0;
                else
                    if (Hod == 1)
                    {
                        Hod = Hod - 2;
                        return 1;
                    }
                    else
                        return 2;
            }
        }

        public int HadaneCisloASazka(int cislo, int sazka)
        {
            trefcislo = 0;
            var cisla = new int[] { a, b, c };
            trefcislo = cisla.Where(x => x == cislo).Count();
            if (trefcislo == 0)
            {
                z= -(sazka);
            }
            else
                z=trefcislo * sazka;
            return z;
        }

        public int Penize
        {
            get
            {
                if (Hod == 2)
                {
                    penizeh2=penizeh2 + z;
                    return (penizeh2);
                }
                else
                {
                    penizeh1=penizeh1 + z;
                    return (penizeh1);
                }
            }
        }

        public int vyhra
        {
            get
            {
                if (penizeh1 <= 0)
                    return 1;
                else
                {
                    if (penizeh2 <= 0)
                        return 2;
                    else
                        return 3;
                }
            }
        }
    }
}

Reakce na odpověď

1 Zadajte svou přezdívku:
2 Napište svou odpověď:
3 Pokud chcete dostat ban, zadejte libovolný text:

Zpět do poradny