title: two dimensional array value swapping c++
body: <pre><code>using namespace std;
  
  string piece;
  string prompt;
  int a,b;
  int board[8][8];
  
  const int  rook = 500;
  const int knight = 300;
  const int bishop = 305;
  const int queen = 900;
  const int king = 2000;
  const int piyon = 100;
  
  int startup[8][8] = {rook,knight,bishop,queen,king,bishop,knight,rook, piyon,piyon,piyon,piyon,piyon,piyon,piyon,piyon,
      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-piyon,-piyon,-piyon,-piyon,-piyon,-piyon,-piyon,-piyon,-rook,-knight,-bishop,-queen,-king,-bishop,-knight,-rook
  };
  
  void initial();
  void updateboard();
  void getinfo();
  void move_piece();
  
  int main(int argc, char** argv) {
  
      initial();
  
      while(true) {
          getinfo();
          updateboard();
      }
      return 0;
  }
  
  void initial() {
      int a,b;
  
      for(a=0;a&lt;8;a++)
      {
          for(b=0;b&lt;8;b++){
              board[a][b] = startup[a][b];        
          }
      }
  }
  
  void updateboard() {
  
      system("cls");
  
      for(a=0;a&lt;8;a++) {
  
          cout&lt;&lt;endl&lt;&lt;endl;
  
          for(b=0;b&lt;8;b++) {
  
              if (board[a][b] == piyon) {
                  piece = "P";
                  goto label;                     
              }
              else if (board[a][b] == king ) {
                  piece= "S";
                  goto label;
              }
              else if(board[a][b] == bishop ) {
                  piece = "F";
                  goto label;
              }
              else if (board[a][b] ==knight) {
                  piece = "A";
                  goto label;
              }
              else if (board[a][b] ==rook) {
                  piece = "R";
                  goto label;
              }
              else if (board[a][b] ==queen) {
                  piece = "V";
                  goto label; 
              }
              else if(board[a][b] == 0)
              {
                  piece = "0";
                  goto label;
              }
              else if(board[a][b] == -king)
               {
                  piece = "s";
                  goto label;
              }
              else if(board[a][b] == -queen)
               {
                  piece = "v";
                  goto label;
              }
              else if(board[a][b] == -rook)
               {
                  piece = "r";
                  goto label;
              }
              else if(board[a][b] == -knight)
               {
                  piece = "a";
                  goto label;
              }
              else if(board[a][b] == -piyon)
               {
                  piece = "p";
                  goto label;
              }
              else if(board[a][b] == -bishop)
               {
                  piece = "f";
                  goto label;
              }
              else {
                  piece = "0";
                  goto label;
              }
  
          label:
              cout&lt;&lt;"  "&lt;&lt;piece&lt;&lt;"  ";
          }   
      }
  }
  
     void move_piece () {
  
      int destinationrow;
      int destinationcol;
      int row;
      int col;
  
      cout&lt;&lt;"its your turn..."&lt;&lt;endl;
      scanf("%d %d",&amp;row,&amp;col);
      scanf("%d %d",&amp;destinationrow,&amp;destinationcol);
  
      int temp;
  }
  
  void getinfo (void) {
  
      cin&gt;&gt;prompt;
  
      if(soru.substr(0,4) == "exit") {
          return;
      }
      if (prompt.substr(0,3)=="new") {
          initial();
      }
      if(soru.substr(0,5)=="print") {
          updateboard();
      }
      if(soru.substr(0,5) == "move") {
          move_piece();
      }
  }
  </code></pre>
  
  <p>here are my program codes, what i exactly want to do is swapping chess squares values so that i will be able to move pieces another squares.
  though i did everything needed for a swap function it didnt work anyway.
  piyon is in integer type and a chess piece that i want to make process on, moving another square. any help would be appreciated. regards..</p>