Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- #include <string>
- #include <iomanip>
- #include <vector>
- using namespace std;
- int main(){
- cout<<"hey"<<endl;
- ifstream inputFile("trevortesttext.txt");
- int mazeH = 0;
- int mazeW = 0;
- int s;
- inputFile >> mazeH;
- inputFile >> mazeW;
- vector<vector<char>> maze (mazeH);
- cout<<mazeH<<endl;
- cout<<mazeW<<endl;
- for(int i = 0; i < mazeH; i++)
- maze[i] = vector<char>(mazeW);
- cout << maze.size()<<endl;
- cout << maze[0].size()<<endl;
- for (int row = 0;row < mazeH; row++)
- {
- for (int col = 0; col < mazeW; col++)
- {
- if (inputFile.peek() == '\n')
- inputFile.get();
- maze[row][col] = inputFile.get();
- }
- }
- for (int col = 0; col < mazeW; col++) //////////////TO TEST PRINT
- {
- for (int row = 0; row < mazeH; row++)
- {
- cout << maze[row][col] << " ";
- }
- cout << endl;
- }
- cin>>s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement