-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColText.hpp
More file actions
44 lines (40 loc) · 1.09 KB
/
ColText.hpp
File metadata and controls
44 lines (40 loc) · 1.09 KB
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
#include <iostream>
#include <termcolor.hpp>
#include <ctime>
#include <string>
#define RED termcolor::red
#define GREEN termcolor::green
#define BLUE termcolor::blue
#define YELLOW termcolor::yellow
#define CYAN termcolor::cyan
#define MAGENTA termcolor::magenta
#define RESET termcolor::reset
using namespace std;
void RES() { cout << RESET; }
void ColText(char* input) {
for(int i = 0; i < strlen(input); i++) {
srand(time(0) + i);
int color = rand() % 6;
switch(color) {
case 0:
cout << RED << input[i];
break;
case 1:
cout << GREEN << input[i];
break;
case 2:
cout << BLUE << input[i];
break;
case 3:
cout << YELLOW << input[i];
break;
case 4:
cout << CYAN << input[i];
break;
case 5:
cout << MAGENTA << input[i];
break;
}
}
RES();
}