-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathE G G.cpp
77 lines (70 loc) · 1.45 KB
/
E G G.cpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include<iostream>
#include<stdlib.h>
#include<unistd.h> // for sleep()
using namespace std;
int color = 0;
int rainbow() {
if(color == 7) {
color = 1;
return color;
}else {
color ++;
return color;
}
}
void printName() {
cout << "\033[1;37m\n\tThis is EEG" << endl;
}
void printEGG() {
cout << "\t ▄ \n";
cout << "\t ▄███▄ \n";
cout << "\t ▄█████▄\n";
cout << "\t ███████\n";
cout << "\t ▀█████▀\n";
}
/*
takes a numeber from 1 to 6 and will color the E E G acordingly
*/
void printEGG(int c) {
if(c == 1) {
printName();
cout << "\033[37m";
printEGG();
}else if(c == 2) {
printName();
cout << "\033[32m";
printEGG();
}else if(c == 3) {
printName();
cout << "\033[33m";
printEGG();
}else if(c == 4) {
printName();
cout << "\033[34m";
printEGG();
}else if(c == 5) {
printName();
cout << "\033[35m";
printEGG();
}else if(c == 6) {
printName();
cout << "\033[36m";
printEGG();
}else if(c == 7) {
printName();
cout << "\033[31m";
printEGG();
}else {
EXIT_FAILURE;
}
}
int main() {
int cColor;
while(true) {
system("clear");
cColor = rainbow();
printEGG(cColor);
sleep(1);
}
return 0;
}