-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConsoleAnimation
48 lines (42 loc) · 910 Bytes
/
ConsoleAnimation
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
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <string>
#include <windows.h>
#include <iostream>
#include <conio.h>
#include <sstream>
#include <math.h>
#include <gl\gl.h>
#pragma comment(lib, "OpenGL32.lib")
using namespace std;
int main()
{
HANDLE screen = GetStdHandle(STD_OUTPUT_HANDLE);
COORD pos = { 40, 3 };
SetConsoleCursorPosition(screen, pos);
cout << "0" << endl;
Sleep(500);
for (int tossIt = 1; tossIt <= 3; tossIt++)
{
while (pos.Y <= 20)
{
SetConsoleCursorPosition(screen, pos);
cout << "|" << endl;
pos.Y++;
SetConsoleCursorPosition(screen, pos);
cout << "O" << endl;
Sleep(100);
}
while (pos.Y > 3)
{
SetConsoleCursorPosition(screen, pos);
cout << " " << endl;
pos.Y--;
SetConsoleCursorPosition(screen, pos);
cout << "O" << endl;
Sleep(100);
}
}
return 0;
}