Exemplo n.º 1
0
 private static Boolean KawigiEdit_RunTest(int testNum, int p0, Boolean hasAnswer, int p1)
 {
     Console.Write("Test " + testNum + ": [" + p0);
     Console.WriteLine("]");
     ShootingGallery obj;
     int answer;
     obj = new ShootingGallery();
     DateTime startTime = DateTime.Now;
     answer = obj.profitableBet(p0);
     DateTime endTime = DateTime.Now;
     Boolean res;
     res = true;
     Console.WriteLine("Time: " + (endTime - startTime).TotalSeconds + " seconds");
     if (hasAnswer) {
         Console.WriteLine("Desired answer:");
         Console.WriteLine("\t" + p1);
     }
     Console.WriteLine("Your answer:");
     Console.WriteLine("\t" + answer);
     if (hasAnswer) {
         res = answer == p1;
     }
     if (!res) {
         Console.WriteLine("DOESN'T MATCH!!!!");
     } else if ((endTime - startTime).TotalSeconds >= 2) {
         Console.WriteLine("FAIL the timeout");
         res = false;
     } else if (hasAnswer) {
         Console.WriteLine("Match :-)");
     } else {
         Console.WriteLine("OK, but is it right?");
     }
     Console.WriteLine("");
     return res;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Civilian        visitor1        = new Civilian("Антон Бурмистров", "05.06.2000", "М", "M4A1", true);
            Military        visitor2        = new Military("Максим Пентешихин", "15.05.1995", "М", "AK-47");
            Civilian        visitor3        = new Civilian("Анна Шеховцова", "24.02.1988", "Ж", "USP", false);
            ShootingGallery shootingGallery = new ShootingGallery();

            shootingGallery.GetGun(visitor1);
            shootingGallery.GetGun(visitor2);
            shootingGallery.GetGun(visitor3);
        }