Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Rock Paper Scissors! ");
            RoshamboApp appTest = new RoshamboApp();

            appTest.RunApp();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            bool repeat = true;

            while (repeat == true)
            {
                Roshambo      rps = new Roshambo();         //Roshambo object rps
                DwayneJohnson ro  = new DwayneJohnson(rps); //Dwayne Johnson object ro
                GrantThompson ra  = new GrantThompson(rps); //Grant Thompson object ra
                UserPlayer    uc  = new UserPlayer(rps);    //User object uc
                RoshamboApp   op  = new RoshamboApp();
                Console.WriteLine("Welcome to Rock, Paper, Scissors! Enter your name:");
                string userName = Console.ReadLine();
                Console.WriteLine("Thanks {0}! Would you like to play against {1} or {2} (DJ/GT)?", userName, ro.GetName(), ra.GetName());
                string userOpponent = op.OpponentName();
                Console.WriteLine("Your opponent is {0}. Rock, paper, or scissors (R/P/S)?", userOpponent);
                Console.WriteLine(userName + ": " + uc.GenerateRoshambo());
                if (userOpponent == "Dwayne Johnson")
                {
                    Console.WriteLine(ro.GetName() + ": " + ro.GenerateRoshambo()); //generate Roshambo using the method defined in the Dwayne Johnson class
                }
                if (userOpponent == "Grant Thompson")
                {
                    Console.WriteLine(ra.GetName() + ": " + ra.GenerateRoshambo()); //generate Roshambo using the method defined in the Grant Thompson class
                }
                repeat = DoAgain();
            }
            Console.WriteLine("Thanks for playing! Goodbye.");
        }
        static void Main(string[] args)
        {
            Player dopey   = new Dopey();
            Player random  = new RandomMan();
            Player chosen  = null;
            int    userNum = Validator.CheckRange(Validator.GetUserInput("Play against\n1. Dopey\n2. Random Man"), 1, 2);

            if (userNum == 1)
            {
                chosen = dopey;
            }
            if (userNum == 2)
            {
                chosen = random;
            }
            Console.WriteLine(RoshamboApp.Play(chosen, "Ryan"));
            Console.WriteLine($"{chosen.Name} throws {chosen.RPS}");
        }
Ejemplo n.º 4
0
 static void Main(string[] args)
 {
     RoshamboApp game = new RoshamboApp();
 }