title: Display Board in a Tic Tac Toe Game
body: <p>I'm currently writing a simple tic-tac-toe game which is proving to be not so simple (at least to me, I'm a beginner). I'm having trouble writing the display_board function which should print something like this:</p>
  
  <pre><code>_|_|_
  _|_|_
   | |
  </code></pre>
  
  <p>And add an X or an O when the player marks the board to a specific location. What I'm planning to do is put this all into a character string but it's kind of confusing especially with the new lines I want to add so the board comes out properly. Does a new line operator count as one or two characters in a string?
  If you want to look at my code for the game, here it is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdbool.h&gt;
  
  int board[3][3] = {
                          {0, 0, 0},
                          {0, 0, 0},
                          {0, 0, 0}
                    };
  
  int main (void)
  {
      int const user1 = 1;
      int const user2 = 2;
      char move[];
  
      while (! all_locations_filled()) {
          printf("User-1, please enter your move:");
          scanf("%s", &amp;move);
  
          if(valid_location(move)) {
              mark_location(user1, move);
              display_board();
          else if(won_the_game(user1) {
              printf("Congratulations User-1, You Won the Game!");
              break;
          }
          else {
              printf("Invalid Move");
          }
          }
          printf("User-2, please enter your move:");
          scanf("%s", &amp;move);
  
          if(valid_location(move)) {
              mark_location(user2, move);
              display_board();
          else if(won_the_game(user2) {
              printf("Congratulations User-2, You Won the Game!");
              break;
          }
          else {
              printf("Invalid Move");
          }
          }
  }
  
  bool valid_location(char str[]) {
      if (str[] == "upperLeft" || str[] == "up" || str[] == "upperRight" || str[] == "left" || str[] == "center" || str[] == "right" || str[] == "lowerLeft" || str[] == "down" || str[] == "lowerRight") {
          return true;
      }
  }
  
  void mark_location(int userU, char str[]) {
      if (str[] == "upperLeft") {
          board[0][0] = userU;
      else if (str[] == "up") {
          board[0][1] = userU;
      else if (str[] == "upperRight") {
          board[0][2] = userU;
      else if (str[] == "left") {
          board[1][0] = userU;
      else if (str[] == "center") {
          board[1][1] = userU;
      else if (str[] == "right") {
          board[1][2] = userU;
      else if (str[] == "lowerLeft") {
          board[2][0] = userU;
      else if (str[] == "down") {
          board[2][1] = userU;
      else if (str[] == "lowerRight") {
          board [2][2] = userU;
      }
  }
  </code></pre>
  
  <p>It's kind of messy, as I said I'm new too this. If you have any suggestions to clean it up, please feel free to give me a hand.</p>