Advertisement
crudechunk

initialBoard

Sep 16th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. void initialBoard(char b[NUM_ROWS][NUM_COLS])
  2. {
  3.     int row, col;
  4.     ifstream inputFile;
  5.     inputFile.open("board.txt");
  6.     /*if(!inputFile)
  7.         {
  8.         cout <<"Error Finding board.txt"<<endl;
  9.         system("pause");
  10.         exit(-1);
  11.         }    
  12.     */
  13.     //Reads in a text file, and initializes board to all '.'    
  14.     for(row=0;row<NUM_ROWS;row++)
  15.         {
  16.         for(col=0;col<NUM_COLS;col++)
  17.             {
  18.             inputFile>>b[row][col];
  19.             //b[row][col] = '.';            
  20.             }
  21.         }
  22.     inputFile.close();        
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement