-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawASCIIArt.cpp
71 lines (68 loc) · 1.31 KB
/
DrawASCIIArt.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
#include<iostream>
#include<fstream>
#include<string>
#include<Windows.h>
using namespace std;
void file();
void BGcolor(int code);
void ShowCur(bool CursorVisibility);
int main()
int main()
{
int x;
SetConsoleOutputCP(65001);
cout << "Type your password: ";
cin >> x;
BGcolor(10);
Sleep(1000);
if (x == 100)//<-- password here!
{
cout << "[Extracting files...]" << endl;
BGcolor(15);
for (int i = 0; i <= 100; i+=10)
{
cout << "...Loading " << i << "%" << endl;
Sleep(500);
}
BGcolor(100);
cout << "Extract files Completed!..." << endl;
cout << endl;
file();
}
else
{
system("color 04");
cout << "Wrong password!" << endl;
}
system("pause");
}
void file()
{
const char* filename = "../banner.txt";//Link file here
BGcolor(10);
for (int i = 1; i < 5; i++)
{
ShowCur(0);
ifstream file;
file.open(filename, ios_base::in);
string line;
while (getline(file, line)) {
cout << line << endl;
Sleep(100);
}
file.close();
}
}
void BGcolor(int code)
{
static HANDLE color = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(color, code);
}
void ShowCur(bool CursorVisibility)
{
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO ConCurInf;
ConCurInf.dwSize = 10;
ConCurInf.bVisible = CursorVisibility;
SetConsoleCursorInfo(handle, &ConCurInf);
}