public override void Play() //rozegranie meczu siatkowki
        {
            Random w = new Random();
            int    l, s, i = 0;

            while (T1Score < 3 && T2Score < 3)
            {
                l = w.Next(2);
                if (l == 0)
                {
                    setScore1 = 25;
                    s         = w.Next(15, 26);
                    setScore2 = s;
                    while (setScore1 - setScore2 < 2)
                    {
                        setScore1++;
                    }
                    T1Score++;
                }
                else
                {
                    setScore2 = 25;
                    s         = w.Next(15, 26);
                    setScore1 = s;
                    while (setScore2 - setScore1 < 2)
                    {
                        setScore2++;
                    }
                    T2Score++;
                }
                Table[i, 0] = setScore1;
                Table[i, 1] = setScore2;
                i++;
            }
            if (T1Score == 3)
            {
                T1.addWin();
                T2.addLose();
            }
            else
            {
                T1.addLose();
                T2.addWin();
            }
        }
Пример #2
0
        public override void Play()
        {
            Random w = new Random();
            int    l = w.Next(2);

            if (l == 0)
            {
                T1Score++;
                T1.addWin();
                T2.addLose();
            }
            else
            {
                T2Score++;
                T2.addWin();
                T1.addLose();
            }
        }