-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanimations.cpp
More file actions
214 lines (204 loc) · 22 KB
/
animations.cpp
File metadata and controls
214 lines (204 loc) · 22 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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#include <unistd.h> // for usleep function
#include <bits/stdc++.h>
#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 */
#define BOLDBLACK "\033[1m\033[30m" /* Bold Black */
#define BOLDRED "\033[1m\033[31m" /* Bold Red */
#define BOLDGREEN "\033[1m\033[32m" /* Bold Green */
#define BOLDYELLOW "\033[33m" /* Bold Yellow */
#define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */
#define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */
#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */
#define BOLDWHITE "\033[1m\033[37m" /* Bold White */
#define UN "\e[4m"
using namespace std;
int main_animation() {
for (int i = 0; i < 50; i ++) printf("\n"); // jump to bottom of console
cout << CYAN "░█████╗░░██████╗ ░██████╗██╗███╗░░░███╗██╗░░░██╗██╗░░░░░░█████╗░████████╗░█████╗░██████╗░\n██╔══██╗██╔════╝ ██╔════╝██║████╗░████║██║░░░██║██║░░░░░██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗\n██║░░██║╚█████╗░ ╚█████╗░██║██╔████╔██║██║░░░██║██║░░░░░███████║░░░██║░░░██║░░██║██████╔╝\n██║░░██║░╚═══██╗ ░╚═══██╗██║██║╚██╔╝██║██║░░░██║██║░░░░░██╔══██║░░░██║░░░██║░░██║██╔══██╗\n╚█████╔╝██████╔╝ ██████╔╝██║██║░╚═╝░██║╚██████╔╝███████╗██║░░██║░░░██║░░░╚█████╔╝██║░░██║\n░╚════╝░╚═════╝░ ╚═════╝░╚═╝╚═╝░░░░░╚═╝░╚═════╝░╚══════╝╚═╝░░╚═╝░░░╚═╝░░░░╚════╝░╚═╝░░╚═╝";
cout <<"\n"<<endl;
cout << WHITE " * COURSE NAME: Operating Systems Lab" << endl;
cout << " * COURSE CODE: CS255" << endl;
cout << " * COURSE INST: Dr. Shashidar S Koolagudi" << endl;
usleep(1<<16);
cout << " \n" UN "Team Members" RESET << endl <<endl;
cout << WHITE " * " CYAN "Addhyan Malhotra " YELLOW "191CS202" << endl;
cout << WHITE " * " CYAN "Abhinav Gupta " YELLOW "191CS201" << endl;
cout << WHITE " * " CYAN "Adithya Rajesh " YELLOW "191CS203" << endl;
cout << WHITE " * " CYAN "Aditya Rudra " YELLOW "191CS204" << endl;
cout << WHITE " * " CYAN "Agarwal Janmansh " YELLOW "191CS205" << endl;
cout << WHITE " * " CYAN "Akash Meena " YELLOW "191CS206" << endl;
cout << WHITE " * " CYAN "Alan Tony " YELLOW "191CS207" << endl;
cout << WHITE " * " CYAN "Aniket Srivastava" YELLOW "191CS208" << endl;
cout << WHITE " * " CYAN "Anupam Lal " YELLOW "191CS209" << endl;
cout << WHITE " * " CYAN "Arnab Das " YELLOW "191CS210" << endl;
long int j=1 <<16;
for (size_t i = 0; i < 10; i++)
{
usleep(j); // move faster and faster,
j = (int)(j * 0.9); // so sleep less each time
cout << endl;
}
return 0;
}
int print_main_menu(){
cout << " \n" YELLOW UN "Choose Algorithm to simulate" RESET << endl <<endl;
cout << WHITE;
cout << " 1. Page Replacement Algorithms"<<endl;
cout << " 2. Deadlock Algorithms"<<endl;
cout << " 3. Process Scheduling" << endl;
cout << " 4. Memory Management" << endl;
cout << " 5. Process Syncronization" << endl;
cout << " 6. Disk Scheduling" << endl;
cout << " 9. Exit\n"<<endl;
long int j=1 <<16;
for (size_t i = 0; i < 10; i++)
{
usleep(j); // move faster and faster,
j = (int)(j * 0.9); // so sleep less each time
cout << endl;
}
cout << YELLOW "Enter your choice : ";
return 0;
}
int paging_animation(){
cout << "\n" <<endl;
cout << "██████╗ █████╗ ██████╗ ███████╗ ██████╗ ███████╗██████╗ ██╗ █████╗ ██████╗███████╗███╗ ███╗███████╗███╗ ██╗████████╗" << endl;
cout << "██╔══██╗██╔══██╗██╔════╝ ██╔════╝ ██╔══██╗██╔════╝██╔══██╗██║ ██╔══██╗██╔════╝██╔════╝████╗ ████║██╔════╝████╗ ██║╚══██╔══╝" << endl;
cout << "██████╔╝███████║██║ ███╗█████╗ ██████╔╝█████╗ ██████╔╝██║ ███████║██║ █████╗ ██╔████╔██║█████╗ ██╔██╗ ██║ ██║ " << endl;
cout << "██╔═══╝ ██╔══██║██║ ██║██╔══╝ ██╔══██╗██╔══╝ ██╔═══╝ ██║ ██╔══██║██║ ██╔══╝ ██║╚██╔╝██║██╔══╝ ██║╚██╗██║ ██║ " << endl;
cout << "██║ ██║ ██║╚██████╔╝███████╗ ██║ ██║███████╗██║ ███████╗██║ ██║╚██████╗███████╗██║ ╚═╝ ██║███████╗██║ ╚████║ ██║ " << endl;
cout << "╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ " <<endl;
long int j=1 <<16;
for (size_t i = 0; i < 10; i++)
{
usleep(j); // move faster and faster,
j = (int)(j * 0.9); // so sleep less each time
cout << endl;
}
return 0;
}
int dead_safe_animation(){
cout << "██████╗ ███████╗ █████╗ ██████╗ ██╗ ██████╗ ██████╗██╗ ██╗\n";
cout << "██╔══██╗██╔════╝██╔══██╗██╔══██╗ ██║ ██╔═══██╗██╔════╝██║ ██╔╝╗\n";
cout << "██║ ██║█████╗ ███████║██║ ██║ ██║ ██║ ██║██║ █████╔╝ \n";
cout << "██║ ██║██╔══╝ ██╔══██║██║ ██║ ██║ ██║ ██║██║ ██╔═██╗ \n";
cout << "██████╔╝███████╗██║ ██║██████╔╝ ███████╗╚██████╔╝╚██████╗██║ ██╗\n";
cout << "╚═════╝ ╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝\n";
cout <<endl;
cout << "███████╗ █████╗ ███████╗███████╗████████╗██╗ ██╗ █████╗ ██╗ ██████╗ ██████╗ ███████╗\n";
cout << "██╔════╝██╔══██╗██╔════╝██╔════╝╚══██╔══╝╚██╗ ██╔╝ ██╔══██╗██║ ██╔════╝ ██╔═══██╗██╔════╝\n";
cout << "███████╗███████║█████╗ █████╗ ██║ ╚████╔╝ ███████║██║ ██║ ███╗██║ ██║███████╗\n";
cout << "╚════██║██╔══██║██╔══╝ ██╔══╝ ██║ ╚██╔╝ ██╔══██║██║ ██║ ██║██║ ██║╚════██║\n";
cout << "███████║██║ ██║██║ ███████╗ ██║ ██║ ██║ ██║███████╗╚██████╔╝╚██████╔╝███████║██╗\n";
cout << "╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝\n";
long int j=1 <<16;
for (size_t i = 0; i < 10; i++)
{
usleep(j); // move faster and faster,
j = (int)(j * 0.9); // so sleep less each time
cout << endl;
}
return 0;
}
int process_sched_animation(){
cout << "██████╗░██████╗░░█████╗░░█████╗░███████╗░██████╗░██████╗" << endl;
cout << "██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔════╝██╔════╝" << endl;
cout << "██████╔╝██████╔╝██║░░██║██║░░╚═╝█████╗░░╚█████╗░╚█████╗░" << endl;
cout << "██╔═══╝░██╔══██╗██║░░██║██║░░██╗██╔══╝░░░╚═══██╗░╚═══██╗" << endl;
cout << "██║░░░░░██║░░██║╚█████╔╝╚█████╔╝███████╗██████╔╝██████╔╝" << endl;
cout << "╚═╝░░░░░╚═╝░░╚═╝░╚════╝░░╚════╝░╚══════╝╚═════╝░╚═════╝░" << endl;
cout << endl;
cout << "░██████╗░█████╗░██╗░░██╗███████╗██████╗░██╗░░░██╗██╗░░░░░██╗███╗░░██╗░██████╗░" << endl;
cout << "██╔════╝██╔══██╗██║░░██║██╔════╝██╔══██╗██║░░░██║██║░░░░░██║████╗░██║██╔════╝░" << endl;
cout << "╚█████╗░██║░░╚═╝███████║█████╗░░██║░░██║██║░░░██║██║░░░░░██║██╔██╗██║██║░░██╗░" << endl;
cout << "░╚═══██╗██║░░██╗██╔══██║██╔══╝░░██║░░██║██║░░░██║██║░░░░░██║██║╚████║██║░░╚██╗" << endl;
cout << "██████╔╝╚█████╔╝██║░░██║███████╗██████╔╝╚██████╔╝███████╗██║██║░╚███║╚██████╔╝" << endl;
cout << "╚═════╝░░╚════╝░╚═╝░░╚═╝╚══════╝╚═════╝░░╚═════╝░╚══════╝╚═╝╚═╝░░╚══╝░╚═════╝░" << endl;
long int j=1 <<16;
for (size_t i = 0; i < 10; i++)
{
usleep(j); // move faster and faster,
j = (int)(j * 0.9); // so sleep less each time
cout << endl;
}
return 0;
}
int mem_animations(){
cout << endl << YELLOW;
cout << "███╗░░░███╗███████╗███╗░░░███╗░█████╗░██████╗░██╗░░░██╗" << endl;
cout << "████╗░████║██╔════╝████╗░████║██╔══██╗██╔══██╗╚██╗░██╔╝" << endl;
cout << "██╔████╔██║█████╗░░██╔████╔██║██║░░██║██████╔╝░╚████╔╝░" << endl;
cout << "██║╚██╔╝██║██╔══╝░░██║╚██╔╝██║██║░░██║██╔══██╗░░╚██╔╝░░" << endl;
cout << "██║░╚═╝░██║███████╗██║░╚═╝░██║╚█████╔╝██║░░██║░░░██║░░░" << endl;
cout << "╚═╝░░░░░╚═╝╚══════╝╚═╝░░░░░╚═╝░╚════╝░╚═╝░░╚═╝░░░╚═╝░░░" << endl;
cout << endl;
cout << "███╗░░░███╗░█████╗░███╗░░██╗░█████╗░░██████╗░███████╗███╗░░░███╗███████╗███╗░░██╗████████╗" << endl;
cout << "████╗░████║██╔══██╗████╗░██║██╔══██╗██╔════╝░██╔════╝████╗░████║██╔════╝████╗░██║╚══██╔══╝" << endl;
cout << "██╔████╔██║███████║██╔██╗██║███████║██║░░██╗░█████╗░░██╔████╔██║█████╗░░██╔██╗██║░░░██║░░░" << endl;
cout << "██║╚██╔╝██║██╔══██║██║╚████║██╔══██║██║░░╚██╗██╔══╝░░██║╚██╔╝██║██╔══╝░░██║╚████║░░░██║░░░" << endl;
cout << "██║░╚═╝░██║██║░░██║██║░╚███║██║░░██║╚██████╔╝███████╗██║░╚═╝░██║███████╗██║░╚███║░░░██║░░░" << endl;
cout << "╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝░░╚═╝░╚═════╝░╚══════╝╚═╝░░░░░╚═╝╚══════╝╚═╝░░╚══╝░░░╚═╝░░░" << endl;
long int j=1 <<16;
for (size_t i = 0; i < 10; i++)
{
usleep(j); // move faster and faster,
j = (int)(j * 0.9); // so sleep less each time
cout << endl;
}
return 0;
}
int sync_animations(){
cout << endl << YELLOW;
cout << "██████╗░██████╗░░█████╗░░█████╗░███████╗░██████╗░██████╗" << endl;
cout << "██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔════╝██╔════╝" << endl;
cout << "██████╔╝██████╔╝██║░░██║██║░░╚═╝█████╗░░╚█████╗░╚█████╗░" << endl;
cout << "██╔═══╝░██╔══██╗██║░░██║██║░░██╗██╔══╝░░░╚═══██╗░╚═══██╗" << endl;
cout << "██║░░░░░██║░░██║╚█████╔╝╚█████╔╝███████╗██████╔╝██████╔╝" << endl;
cout << "╚═╝░░░░░╚═╝░░╚═╝░╚════╝░░╚════╝░╚══════╝╚═════╝░╚═════╝░" << endl;
cout << endl;
cout << "░██████╗██╗░░░██╗░█████╗░██████╗░░█████╗░███╗░░██╗██╗░██████╗░█████╗░████████╗██╗░█████╗░███╗░░██╗" << endl;
cout << "██╔════╝╚██╗░██╔╝██╔══██╗██╔══██╗██╔══██╗████╗░██║██║██╔════╝██╔══██╗╚══██╔══╝██║██╔══██╗████╗░██║" << endl;
cout << "╚█████╗░░╚████╔╝░██║░░╚═╝██████╔╝██║░░██║██╔██╗██║██║╚█████╗░███████║░░░██║░░░██║██║░░██║██╔██╗██║" << endl;
cout << "░╚═══██╗░░╚██╔╝░░██║░░██╗██╔══██╗██║░░██║██║╚████║██║░╚═══██╗██╔══██║░░░██║░░░██║██║░░██║██║╚████║" << endl;
cout << "██████╔╝░░░██║░░░╚█████╔╝██║░░██║╚█████╔╝██║░╚███║██║██████╔╝██║░░██║░░░██║░░░██║╚█████╔╝██║░╚███║" << endl;
cout << "╚═════╝░░░░╚═╝░░░░╚════╝░╚═╝░░╚═╝░╚════╝░╚═╝░░╚══╝╚═╝╚═════╝░╚═╝░░╚═╝░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝" << endl;
long int j=1 <<16;
for (size_t i = 0; i < 10; i++)
{
usleep(j); // move faster and faster,
j = (int)(j * 0.9); // so sleep less each time
cout << endl;
}
return 0;
}
int disk_animations(){
cout << endl << YELLOW;
cout << "██████╗░██╗░██████╗██╗░░██╗" << endl;
cout << "██╔══██╗██║██╔════╝██║░██╔╝" << endl;
cout << "██║░░██║██║╚█████╗░█████═╝░" << endl;
cout << "██║░░██║██║░╚═══██╗██╔═██╗░" << endl;
cout << "██████╔╝██║██████╔╝██║░╚██╗" << endl;
cout << "╚═════╝░╚═╝╚═════╝░╚═╝░░╚═╝" << endl;
cout << endl;
cout << "███╗░░░███╗░█████╗░███╗░░██╗░█████╗░░██████╗░███████╗███╗░░░███╗███████╗███╗░░██╗████████╗" << endl;
cout << "████╗░████║██╔══██╗████╗░██║██╔══██╗██╔════╝░██╔════╝████╗░████║██╔════╝████╗░██║╚══██╔══╝" << endl;
cout << "██╔████╔██║███████║██╔██╗██║███████║██║░░██╗░█████╗░░██╔████╔██║█████╗░░██╔██╗██║░░░██║░░░" << endl;
cout << "██║╚██╔╝██║██╔══██║██║╚████║██╔══██║██║░░╚██╗██╔══╝░░██║╚██╔╝██║██╔══╝░░██║╚████║░░░██║░░░" << endl;
cout << "██║░╚═╝░██║██║░░██║██║░╚███║██║░░██║╚██████╔╝███████╗██║░╚═╝░██║███████╗██║░╚███║░░░██║░░░" << endl;
cout << "╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝░░╚═╝░╚═════╝░╚══════╝╚═╝░░░░░╚═╝╚══════╝╚═╝░░╚══╝░░░╚═╝░░░" << endl;
long int j=1 <<16;
for (size_t i = 0; i < 10; i++)
{
usleep(j); // move faster and faster,
j = (int)(j * 0.9); // so sleep less each time
cout << endl;
}
return 0;
}