Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "time.h"
- #include <iostream>
- using namespace std;
- void main()
- {
- int input, num;
- srand(time(NULL));
- do {
- system("cls");
- cout << " +--------------------+" << endl;
- cout << " | What dice |" << endl;
- cout << " +--------------------+" << endl;
- cout << " | 1 - d6 |" << endl;
- cout << " | 2 - d20 |" << endl;
- cout << " +--------------------+" << endl << endl;;
- cout << " ";
- cin >> input;
- switch (input) {
- case 1:
- num = rand() % 6 + 1;
- break;
- case 2:
- num = rand() % 20 + 1;
- break;
- }
- cout << endl << " " << num << endl << endl << " ";
- system("pause");
- } while (1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement