Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdio>
  4. #include <cstdlib>
  5. #include <ctime>
  6. #include "iodos.h"
  7.  
  8. void clear();
  9.  
  10. int main()
  11. {
  12.     dos_console();
  13.     clear();
  14.     char choice;
  15.     srand(time(NULL));
  16.     const int antal = 17;
  17.     std::string gameModes[antal] = { "Team Deathmatch", "Domination", "Ground War", "Demolition", "Sabotage", "Headquarters Pro", "Search and Destroy", "Barebones Pro", "Team Tactical",
  18.                                 "Hardcore Ricochet: SD", "Hardcore Team Deathmatch", "3rd Person Team Tactical", "Team Deathmatch Express", "Objective Barebones Pro",
  19.                                 "Hardcore Ricochet: HQ Pro", "Capture the Flag", "Hardcore Mosh Pit"};
  20.     while (true) {
  21.         int random = (rand() % antal);
  22.         std::cout << "Slumpat gamemode: " << gameModes[random] << std::endl;
  23.         std::cout << "Dåligt resultat? \nVill du försöka igen? (y/n): ";
  24.         std::cin >> choice;
  25.         if (choice == 'y') {
  26.             clear();
  27.         } else {
  28.             break;
  29.         }
  30.     }
  31.     return 0;
  32. }
  33.  
  34. void clear() {
  35.     for (int i = 0; i < 100; i++) {
  36.         std::cout << std::endl;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement