Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.59 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <cstdlib>
  4. #include <vector>
  5. #include <string>
  6. #include <string.h>
  7. #include <time.h>
  8. #include <ctime>
  9. #include <array>
  10. #include <algorithm>
  11. #include <chrono>
  12. #include <random>  
  13. using namespace std;
  14.  
  15. int main()
  16. {
  17.     int geben;
  18.     int halter;
  19.  
  20.     unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
  21.     std::vector <string> foo =  { "7Pick", "8Pick", "9Pick", "10Pick", "BubePick", "DamePick", "KoenigPick", "AsPick" };
  22.     do
  23.     {
  24.     int x = 0;
  25.             std::cin >> geben;
  26.             shuffle(foo.begin(), foo.end(), std::default_random_engine(seed));
  27.    
  28.             if (foo[0] == "7Pick" || foo[1] == "7Pick" || foo[2] == "7Pick") { x += 7;  }
  29.             if (foo[0] == "8Pick" || foo[1] == "8Pick" || foo[2] == "8Pick") { x += 8;  }
  30.             if (foo[0] == "9Pick" || foo[1] == "9Pick" || foo[2] == "9Pick") { x += 9;  }
  31.             if (foo[0] == "10Pick" || foo[1] == "10Pick" || foo[2] == "10Pick") { x += 10;  }
  32.             if (foo[0] == "BubePick" || foo[1] == "BubePick" || foo[2] == "BubePick") { x += 10;  }
  33.             if (foo[0] == "DamePick" || foo[1] == "DamePick" || foo[2] == "DamePick") { x += 10;  }
  34.             if (foo[0] == "KoenigPick" || foo[1] == "KoenigPick" || foo[2] == "KoenigPick") { x += 10;  }
  35.             if (foo[0] == "AsPick" || foo[1] == "AsPick" || foo[2] == "AsPick") { x += 11;  }
  36.             std::cout << foo[0] << " " << foo[1] << " " << foo[2] << endl;
  37.             std::cout << x << endl;
  38.        
  39.             foo.erase(foo.begin(), foo.begin() + 3);
  40.             if (foo.size() < 3)
  41.             {
  42.                 cout << "Keine karten mehr" << endl;
  43.             }
  44.            
  45.         } while (geben == 1);
  46.     std::cout << endl;
  47.    
  48.     std::system("PAUSE");
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement