-
Notifications
You must be signed in to change notification settings - Fork 0
/
Misc.hpp
51 lines (46 loc) · 904 Bytes
/
Misc.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Misc.hpp
#pragma once
#include <random>
#define RESET "\033[0m"
#define BLACK "\033[30m" /* Black */
#define RED "\033[31m" /* Red */
#define GREEN "\033[32m" /* Green */
#define YELLOW "\033[33m" /* Yellow */
#define BLUE "\033[34m" /* Blue */
#define MAGENTA "\033[35m" /* Magenta */
#define CYAN "\033[36m" /* Cyan */
#define WHITE "\033[37m" /* White */
using namespace std;
int randomNumber(int min, int max) {
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> uid(min, max);
return uid(mt);
}
void colors(char c) {
switch (c) {
case 'x':
cout << RESET;
break;
case 'r':
cout << RED;
break;
case 'g':
cout << GREEN;
break;
case 'y':
cout << YELLOW;
break;
case 'b':
cout << BLUE;
break;
case 'm':
cout << MAGENTA;
break;
case 'c':
cout << CYAN;
break;
default:
break;
}
}