title: Using 2D Array for Tic Tac Toe in Visual Basic
body: <p>I have to make a tic tac toe game for my Visual Basic class that uses an array to keep track of the state of the game, but I have no idea how to set up this array. The program is supposed to have 2 views (a GUI which I have already done, and a text view using the console which I have no idea how to do), has two controllers (the user can click the button where they want to play, or they can use the keys 1-9 on the keyboard to choose their position), and is to be played between a human and the computer.</p>
  
  <p>It's not much, but here's what I have so far:</p>
  
  <pre><code>  Module Module1
  Const intMAX_ROWS As Integer = 2
  Const intMAX_COL As Integer = 2
  Public gameArray(intMAX_ROWS, intMAX_COL) As String
  
  Button1.Text = gameArray(0,0) 
  Button2.Text = gameArray(0,1)
  Button3.Text = gameArray(0,2)
  Button4.Text = gameArray(1,0)
  Button5.Text = gameArray(1,1)
  Button6.Text = gameArray(1,2)
  Button7.Text = gameArray(2,0)
  Button8.Text = gameArray(2,1)
  Button9.Text = gameArray(2,2)
  
  End Module
  </code></pre>
  
  <p>I am getting an error on all of the Button.Text lines saying </p>
  
  <pre><code>Declaration expected
  </code></pre>
  
  <p>Any ideas on how to fix that?</p>
  
  <p>Any help or suggestions would be greatly appreciated. </p>