SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. std::string coord[9] = {"ce", "we", "ea", "ne", "no", "ne", "sw", "so", "se"};
  4. char options;
  5.  
  6. int n1;
  7. int e1;
  8. int s1;
  9. int w1;
  10.  
  11. int main() {
  12.   while (true) {
  13.     std::cin >> options;
  14.     switch(options)
  15.     {
  16.       case 'n': { if(s1 == 0) {
  17.         n1++;
  18.       } else{
  19.         s1--;
  20.       } std::cout << n1; std::cout << "\n"; std::cout << s1; std::cout << "\n"; break; }
  21.       case 'e': { if(w1 == 0) {
  22.         e1++;
  23.       } else{
  24.         w1++;
  25.       } std::cout << e1; std::cout << "\n"; std::cout << w1; std::cout << "\n"; break; }
  26.       case 's': { if(n1 == 0){
  27.         s1++;
  28.       } else{
  29.         n1--;
  30.       } std::cout << s1; std::cout << "\n"; std::cout << n1; std::cout << "\n"; break; }
  31.       case 'w': { if(e1 == 0){
  32.         w1++;
  33.       } else {
  34.         e1--;
  35.       } std::cout << w1; std::cout << "\n"; std::cout << e1; std::cout << "\n"; break; }
  36.     }
  37.   }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top