Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main (string[] args)
- {
- int score = 0;
- int pcscore = 0;
- do {
- Console.WriteLine("Choose: Rock / Paper / Scissors");
- string choice = Console.ReadLine();
- string pcChoise;
- Random rnd = new Random();
- randomint = rnd.Next(1,3);
- switch (randomint)
- {
- case 1:
- pcChoise = "Rock";
- break;
- case 2:
- pcChoise = "Paper";
- break;
- case 3:
- pcChoise = "Scissors";
- break;
- }
- Console.WriteLine("Computer chose " + pcChoise);
- if (choice == pcChoise)
- {
- Console.WriteLine("Draw");
- }
- if (choice == "Rock")
- {
- if (pcChoise == "Paper")
- {
- Console.WriteLine("Computer won");
- pcscore++;
- }
- if (pcChoice == "Scissors")
- {
- Console WriteLine("You won");
- score++;
- }
- }
- if (choice == "Paper")
- {
- if (pcChoice == "Rock")
- {
- Console.WriteLine("You won");
- score++;
- }
- if (pcChoise == "Scissors")
- {
- Console.WriteLine("Computer won");
- pcscore++;
- }
- }
- if (choice == "Scissors")
- {
- if (pcChoice == "Rock")
- {
- Console.WriteLine("Computer won");
- pcscore++;
- }
- if (pcChoice == "Paper")
- {
- Console.WriteLine("You won");
- score++;
- }
- }
- }
- Console.WriteLine("Press 'y' to Continue / 'x' to stop");
- char cont = char.Parse(Console.ReadLine());
- }
- while (cont == y);
- Console.WriteLine("Your Score: {0}",score);
- Console.WriteLine("PC Score: {0}",pcscore);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement