-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintFunctions.h
More file actions
119 lines (113 loc) · 3.2 KB
/
Copy pathPrintFunctions.h
File metadata and controls
119 lines (113 loc) · 3.2 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
#ifndef PRINTFUNCTIONS_H_
#define PRINTFUNCTIONS_H_
#include "graphics.h"
// contain
void inngang(int x1, int x2, int y) { //print ---------->
if (x1 < x2) {
for (int i = x1 + 1; i < x2 - 1; i++) {
gotoxy(i, y); cout << char(196);
}
cout << ">";
}
else if (x1 > x2) {
gotoxy(x2, y); cout << "<";
for (int i = x2 + 1; i < x1; i++) {
gotoxy(i, y); cout << char(196);
}
}
}
void indoc(int x, int y1, int y2) { //print : |
if (y1 < y2) { // |
for (int i = y1 + 1; i < y2 - 1; i++) {// V
gotoxy(x, i); cout << char(179);
}
gotoxy(x, y2 - 1); cout << char(281);
}
else if (y1 > y2) {
gotoxy(x, y2 + 1); cout << char(280);
for (int i = y2 + 2; i <= y1; i++) {
gotoxy(x, i); cout << char(179);
}
}
}
void printRectangle(int x1, int x2, int y1, int y2) {
gotoxy(x1, y1); cout << char(474);
gotoxy(x2, y1); cout << char(439);
gotoxy(x1, y2); cout << char(468);
gotoxy(x2, y2); cout << char(473);
for (int i = x1+1; i <= x2-1; i++) {
gotoxy(i, y1); cout << char(196);
gotoxy(i, y2); cout << char(196);
}
for (int i = y1 + 1; i <= y2-1; i++) {
gotoxy(x1, i); cout << char(179);
gotoxy(x2, i); cout << char(179);
}
}
void inngang_Color(int x1, int x2, int y) {
if (x1 < x2) {
for (int i = x1 + 1; i < x2 - 1; i++) {
gotoxy(i, y);
Sleep(50);
cout << char(249);
}
Sleep(50);
cout << ">";
}
else if (x1 > x2) {
for (int i = x1; i >= x2 + 1; i--) {
gotoxy(i, y);
Sleep(50);
cout << char(249);
}
gotoxy(x2, y); cout << "<";
}
}
void indoc_Color(int x, int y1, int y2) {
if (y1 < y2) {
for (int i = y1 + 1; i < y2 - 1; i++) {
gotoxy(x, i); Sleep(50); cout << char(!49);
}
gotoxy(x, y2 - 1); Sleep(50); cout << "v";
}
else if (y1 > y2) {
for (int i = y1; i >= y2 + 2; i--) {
gotoxy(x, i); Sleep(50); cout << char(249);
}
gotoxy(x, y2 + 1); Sleep(50); cout << "^";
}
}
void printMainMenu() {
resizeConsole(300, 400);
textcolor(7);;
system("cls");
//print frames
printRectangle(4, 35, 4, 6);
printRectangle(4, 35, 7, 9);
printRectangle(4, 35, 10, 12);
printRectangle(4, 35, 13, 15);
printRectangle(4, 35, 16, 18);
printRectangle(4, 35, 19, 21);
//print conntent
textcolor(11) ;
gotoxy(5, 5); cout << "Please enter your choice!";
gotoxy(5, 8); cout << "1 to show ITEM1";
gotoxy(5, 11); cout << "2 to show ITEM2";
gotoxy(5, 14); cout << "3 to show ITEM3";
gotoxy(5, 17); cout << "4 to show ITEM4";
gotoxy(5, 20); cout << "Other to quit";
}
void printNumOftoken(map<string, int> marking, string nameOFplace, int x, int y) {
gotoxy(x, y);
textcolor(3);
if (marking[nameOFplace] > 9) {
cout << marking[nameOFplace];
textcolor(15);
cout << ")";
textcolor(15);
}
else {
cout << marking[nameOFplace];
}
}
#endif // !PRINTFUNCTIONS_H_