Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Rock_Paper_Scissors
- {
- class Program
- {
- static void Main(string[] args)
- {
- int ask = AskRockPaperScissor();
- }
- static int AskRockPaperScissor()
- {
- int answer = -1;
- bool success = false;
- int nRounds = -1;
- int loss = 0;
- int win = 0;
- int tie = 0;
- Console.WriteLine("Welcome to play Rock, Paper, Scissors!");
- Console.WriteLine("How many round you wanna play?");
- int.TryParse(Console.ReadLine().Trim(), out nRounds);
- while (!success)
- {
- Random rnd = new Random();
- int computerG = rnd.Next(3);
- Console.WriteLine("Okay we play " + nRounds + " more rounds.");
- Console.WriteLine("Pick one! Rock 0), Paper 1), and Scissors 2)");
- int.TryParse(Console.ReadLine().Trim(), out answer);
- switch (answer)
- {
- case 0:
- Console.WriteLine("You picked Röck Bröther");
- if (computerG == 0)
- {
- Console.WriteLine("I picked Rock too bröther! We tied man, we tied!");
- tie++;
- }
- else if (computerG == 1)
- {
- Console.WriteLine("I picked Paper, Paper wraps the Rock, I win!");
- loss++;
- }
- else if (computerG == 2)
- {
- Console.WriteLine("I picked Scissors, Rock breaks Scissors so you win, gratz buddy!");
- win++;
- }
- nRounds--;
- break;
- case 1:
- Console.WriteLine("You picked Päper Bröther");
- if (computerG == 0)
- {
- Console.WriteLine("I picked Rock, Paper wraps the Rock so you win! Gratz buddy!");
- win++;
- }
- else if (computerG == 1)
- {
- Console.WriteLine("I picked Paper too! We tied man, we tied!");
- tie++;
- }
- else if (computerG == 2)
- {
- Console.WriteLine("I picked Scissors, Scissors cut the Paper, you did not win :(");
- loss++;
- }
- nRounds--;
- break;
- case 2:
- Console.WriteLine("You picked Scissörs Bröther");
- if (computerG == 0)
- {
- Console.WriteLine("I picked Rock, my Rock breaks your Scissors, I win!");
- loss++;
- }
- else if (computerG == 1)
- {
- Console.WriteLine("I picked Paper, Scissors cut the Paper, you win...");
- win++;
- }
- else if (computerG == 2)
- {
- Console.WriteLine("I picked Scissors too, no homo but we scissoring... Let's just say we tied...");
- tie++;
- }
- nRounds--;
- break;
- default:
- Console.WriteLine("You bad, You not listen! Try again!");
- break;
- }
- if (nRounds == 0)
- {
- int rounds = loss + win + tie;
- Console.WriteLine("We have played as long as you wanted and the results are Following: ");
- Console.WriteLine("Rounds: " + rounds);
- Console.WriteLine("Wins: " + win);
- Console.WriteLine("Losses: " + loss);
- Console.WriteLine("Ties: " + tie);
- Console.Read();
- success = true;
- }
- }
- return answer;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement