Guest User

Untitled

a guest
May 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. player = getStartLocation(); == this part is in the main.cpp trying to call getStartLocation
  2. Player is a Location type.
  3.  
  4.  
  5. class World
  6. {
  7. public:
  8. World(string);
  9. World(const World&);
  10. Location getStartLocation() const; == this is the world.h file declaration thingermabbober dohickey
  11.  
  12.  
  13.  
  14. Location World::getStartLocation() const === this is the code in getstartlocation
  15. {
  16. string one = ""; // this makes me look smurt
  17. string two = "";
  18. string three = "";
  19. int r1;
  20. stringstream out;
  21. stringstream out2;
  22.  
  23.  
  24.  
  25. for (int i = 0; i < 10; i++)
  26. {
  27. for (int j=0; j < 10; j++)
  28. {
  29. if (w[i][j] == 1)
  30. {
  31.  
  32. out << i;
  33. one = out.str();
  34. out2 << j;
  35. two = out2.str();
  36.  
  37. three = one + two;
  38.  
  39. r1 = atoi(three.c_str());
  40.  
  41. return r1;
  42. }
  43. }
  44. }
  45.  
  46. }
Add Comment
Please, Sign In to add comment