Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace WorkingWithDates
- {
- class Program
- {
- static string userChoice = "Scissors";
- static string cpuChoice = "Rock";
- static void Main(string[] args)
- {
- Console.WriteLine("User chooses {0}",userChoice);
- Console.WriteLine("Computer chooses {0}", cpuChoice);
- Play();
- Console.ReadLine();
- }
- //Check to see win condition
- static void Play()
- {
- if (userChoice == cpuChoice)
- Console.WriteLine("Tie");
- else
- {
- if (userChoice == "Rock" && cpuChoice == "Scissors")
- Console.WriteLine("You Win!");
- if (userChoice == "Rock" && cpuChoice == "Paper")
- Console.WriteLine("You Lose");
- if (userChoice == "Paper" && cpuChoice == "Rock")
- Console.WriteLine("You Win!");
- if (userChoice == "Paper" && cpuChoice == "Scissors")
- Console.WriteLine("You Lose");
- if (userChoice == "Scissors" && cpuChoice == "Paper")
- Console.WriteLine("You Win!");
- if (userChoice == "Scissors" && cpuChoice == "Rock")
- Console.WriteLine("You Lose");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement