title: Rock paper scissors game with a window
body: <p>I'm working on a Rock, paper, scissors game for a school assignment, But when I try to run this script the game doesn't work properly. When I click Rock for example the computer only picks the same or picks paper. But the player never wins. I don't know how to fix this, Ive been trying for hours. This is my code:</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      string Computer;
      string[] computer = { "Rock", "Paper", "Scissors" };
      Random random = new Random();
      int RandomType;
      string PlayerPicks;
  
      public MainWindow()
      {
          InitializeComponent();
      }
  
      private void StoneButton_Click(object sender, RoutedEventArgs e)
      {
          PlayerPicks = "Rock";
          RandomType = random.Next(0, 2);
          Computer = computer[RandomType];
          Game();
      }
  
      private void PaperButton_Click(object sender, RoutedEventArgs e)
      {
          PlayerPicks = "Paper";
          RandomType = random.Next(0, 2);
          Computer = computer[RandomType];
          Game();
      }
  
      private void ScissorsButton_Click(object sender, RoutedEventArgs e)
      {
          PlayerPicks = "Scissors";
          RandomType = random.Next(0, 2);
          Computer = computer[RandomType];
          Game();
      }
  
      void Game()
      {
          string message = "The winner is: ";
          string computerWins = "Computer!";
          string playerWins = "Player!";
          string draw = "N-Nobody?";
  
  
          if (PlayerPicks == "Rock" &amp;&amp; Computer == "Paper") // Player: Rock, Computer: paper = computer wins
          {
              MessageBox.Show(message + computerWins);
          }
          else if (PlayerPicks == "Rock" &amp;&amp; Computer == "Scissors") // Player: Rock, Computer: Scissors = Player wins
          {
              MessageBox.Show(message + playerWins);
  
          }
          else if (PlayerPicks == "Paper" &amp;&amp; Computer == "Scissors") // Player: Paper, Computer: Scissors = Computer wins
          {
              MessageBox.Show(message + computerWins);
  
          }
          else if (PlayerPicks == "Paper" &amp;&amp; Computer == "Rock") // Player: Paper, Computer: Rock = Player wins
          {
              MessageBox.Show(message + playerWins);
  
          }
          else if (PlayerPicks == "Scissors" &amp;&amp; Computer == "Rock") // Player: Scissors, Computer: Rock = Computer wins
          {
              MessageBox.Show(message + computerWins);
  
          }
          else if (PlayerPicks == "Scissors" &amp;&amp; Computer == "Paper") // Player: Scissors, Computer: Paper = Player wins
          {
              MessageBox.Show(message + playerWins);
  
          }
          if (PlayerPicks == "Scissors" &amp;&amp; Computer == "Scissor")
          {
              MessageBox.Show(message + draw);
  
          }
          if (PlayerPicks == "Paper" &amp;&amp; Computer == "Paper")
          {
              MessageBox.Show(message + draw);
          }
          if (PlayerPicks == "Rock" &amp;&amp; Computer == "Rock")
          {
              MessageBox.Show(message + draw);
          }
  </code></pre>