title: Domineering C++ game
body: <p>I am making a domineering game for my coursework, I have been trying to do something new by adding a lot of void functions and now for some weird reason my board isn't working as it is saying identifier "board" is undefined but I have never really had a problem with my board until now and I haven't figured it out yet. The error is in the void playAt() function.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;Windows.h&gt;
  #include &lt;vector&gt;
  using namespace std;
  int horizontal = 0;
  int vertical = 0;
  int row = 0;
  int column = 0;
  int x = row = 0;
  int y = column = 0;
  bool gameOver;
  bool player = horizontal &amp;&amp; vertical;
  bool islegal;
  
  void Setup()
  {
      gameOver = false;
  }
  void Draw()
  {
      // specifty default value to fill the vector elements
      int mapSize = 0;
  
      cout &lt;&lt; "Enter the size of board =&gt; ";
      cin &gt;&gt; mapSize;
  
      vector&lt;vector&lt;char&gt; &gt; board(mapSize, vector&lt;char&gt;(mapSize, 'e'));
      for (int i = 0; i &lt; mapSize; i++) {
          for (int j = 0; j &lt; mapSize; j++) {
              cout &lt;&lt; board[i][j] &lt;&lt; " ";
          }
          cout &lt;&lt; endl;
      }
  }
  void play()
  {
      if (player == horizontal) {
          cout &lt;&lt; ("Horizontal to play");
      }
      else {
          cout &lt;&lt; ("Vertical to play");
      }
  }
  void playAt(int row, int column, bool player)
  {
      board[row][column] = true;
      if (player == horizontal) {
          board[x][y + 1] = true;
          board[x][y + 2] = true;
      }
      else {
          board[x + 1][y] = true;
          board[x + 2][y] = true;
      }
  }
  void Input()
  {
  }
  void Logic()
  {
  }
  int main()
  {
      Setup();
      while (!gameOver) {
          Draw();
          Input();
          Logic();
      }
  }
  </code></pre>