Esempio n. 1
0
        private void swap(int first, int second)
        {
            Cups c = cupsArray[first];

            cupsArray[first]  = cupsArray[second];
            cupsArray[second] = c;
        }
Esempio n. 2
0
        public Controller()
        {
            cupsArray = new Cups[3];
            Cups A = new Cups("A"), B = new Cups("B"), C = new Cups("C");

            cupsArray[0] = A;
            cupsArray[1] = B;
            cupsArray[2] = C;
            r            = new Random();
            Ball ball = new Ball();

            ballStart = r.Next(0, 3);
            cupsArray[ballStart].setBall(ball);
            Console.WriteLine("Welcome to the Cups game! The ball is currently under cup #{0}.\n", ballStart + 1);
        }