Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// string test
- #include <iostream>
- #include <string>
- using namespace std;
- void mapdatatogrid(string mapdata);
- int main()
- {
- /// define map
- string mapdata;
- /// append map
- mapdata.append("!-6:-4:A:3:3!2:-4:A:3:3!-6:-4:A:3:3!-6:-4:A:3:3");
- mapdatatogrid(mapdata);
- return 0;
- }
- /// convert map to grid
- void mapdatatogrid(string mapdata)
- {
- std::size_t findfirstcluster;
- std::size_t findfirstnoncluster;
- std::size_t findclusterend;
- bool decluster = true;
- /// find first cluster
- findfirstcluster= mapdata.find("!");
- findfirstnoncluster= mapdata.find("#");
- cout << findfirstcluster << " " << findfirstnoncluster;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement