-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.cpp
More file actions
28 lines (24 loc) · 798 Bytes
/
Copy pathbase.cpp
File metadata and controls
28 lines (24 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <string>
#include <vector>
// base.cpp
// jeff tecca, 2015-06-18
void print_map(const std::vector<std::string>&);
std::vector <std::vector <std::string> > initialize_map(const int& width, const int& height)
{
// std::vector<std::string> test(width, ".");
// print_map(test);
std::vector <std::vector <std::string> > gamemap(height, std::vector<std::string>(width, "."));
return gamemap;
}
void print_map(const std::vector <std::vector <std::string> >& gamemap)
{
typedef std::vector<std::string>::size_type vec_str;
for(vec_str i = 0; i != gamemap.size(); ++i) {
for(vec_str j = 0; j != gamemap[i].size(); ++j) {
std::cout << gamemap[i][j];
std::cout << " ";
}
std::cout << std::endl;
}
}