title: Dart Scoring Game Using C# Visual Studio 2010 - Alternating player score after evey 3rd score
body: <p>Just bought a dartboard and thought to create a little scoring application, so far i have set up the player names and individual buttons to start the game. three games - 301, 501 and 1001, these are the targets scores to get to zero by throwing three darts each in turn by two players.
  I have included many buttons for the score of each dart from 20 down to 1, each for single, double, triple, bull, outer bull and a no score button. Once the games starts the first three button presses should be attributed to player one then the following three buttons pressed to allocate the corresponding score to player 2. The games ends with the winning player achieving the target score (or whittles it down to zero).</p>
  
  <p>I could have a player selection button to do this but was after some tips on a way of coding the alternate pattern of scoring to be automatic.</p>
  
  <p>Any help greatly appreciated. Thank you</p>
  
  <pre><code>namespace dbstats
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
  
          btnPlay.Visible = false;
          btnReset.Visible = false;
          btnUndo.Visible = false;
          gbDartBoard.Visible = false;
          gbScoreBoard.Visible = false;
          lbP1Select.Visible = false;;
          lbP2Select.Visible = false;
          cmbP1.Visible = false;
          cmbP2.Visible = false;
  
          string[] lines = File.ReadAllLines(@"playerStats.csv");
          foreach (var line in lines)            
          {
              string[] names = line.Split(',');
              if (names[0] != "NAME")
              {
                  cmbP1.Items.Add(names[0]);
                  cmbP2.Items.Add(names[0]);
              } 
          }
      }
  
      private void tsm301_Click(object sender, EventArgs e)
      {
          lbP1Select.Visible = true;
          cmbP1.Visible = true;
          lbP2Select.Visible = true;
          cmbP2.Visible = true;
          btnPlay.Visible = true;
          tbPlayer1.Text = "301";
          tbPlayer2.Text = "301";
  
          gamesToolStripMenuItem.Visible = false;
          manageToolStripMenuItem.Visible = false;
      }
  
      private void btnPlay_Click(object sender, EventArgs e)
      {
          if (cmbP1.SelectedItem == cmbP2.SelectedItem || cmbP1.SelectedItem == null || cmbP2.SelectedItem == null)
          {
              MessageBox.Show("Make Sure:" + "\n\n"
                              + "The Players are NOT the same." + "\n"
                              + "&amp;" + "\n"
                              + "At least one selection is NOT left blank", "Choose Again!");
          }
          else
          {
              lbP1Select.Visible = false;
              cmbP1.Visible = false;
              lbP2Select.Visible = false;
              cmbP2.Visible = false;
              btnPlay.Visible = false;
  
              lbPlayer1.Text = cmbP1.SelectedItem.ToString();
              lbPlayer2.Text = cmbP2.SelectedItem.ToString();
  
              btnReset.Visible = true;
              btnUndo.Visible = true;
              gbDartBoard.Visible = true;
              gbScoreBoard.Visible = true;
              lbPlayer1.Visible = true; ;
              lbPlayer2.Visible = true;                
          }
      }
  }
  </code></pre>