Advertisement
vivienneanthony

crashed

Aug 27th, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. /// string test
  2.  
  3. #include <iostream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. void mapdatatogrid(string mapdata);
  9.  
  10. int main()
  11. {
  12.     /// define map
  13.     string mapdata;
  14.  
  15.     /// append map
  16.     mapdata.append("!-6:-4:A:3:3!2:-4:A:3:3!-6:-4:A:3:3!-6:-4:A:3:3");
  17.  
  18.     mapdatatogrid(mapdata);
  19.  
  20.  
  21.     return 0;
  22. }
  23.  
  24. /// convert map to grid
  25. void mapdatatogrid(string mapdata)
  26. {
  27.     std::size_t findfirstcluster;
  28.     std::size_t findfirstnoncluster;
  29.     std::size_t findclusterend;
  30.  
  31.     bool decluster = true;
  32.  
  33.     /// find first cluster
  34.     findfirstcluster= mapdata.find("!");
  35.     findfirstnoncluster= mapdata.find("#");
  36.    
  37.     cout << findfirstcluster << " " << findfirstnoncluster;
  38.  
  39.     return;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement