-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraw.h
34 lines (31 loc) · 1.24 KB
/
draw.h
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
#include <iostream>
#include <string>
int cnt;
int place;
std::string array = "__________________________________\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n| |\n|________________________________|\n";
char* draw_dot(int posx, int posy, std::string symbol){
place=34;
while(posy > cnt){
place=place+34;
cnt++;
}
place=place+cnt+2;
place=place+posx;
cnt = 0;
array.replace(place, 1, symbol);
char* c = array.data();
return c;
}
char* erase_dot(int posx, int posy){
place=34;
while(posy > cnt){
place=place+34;
cnt++;
}
place=place+cnt+2;
place=place+posx;
cnt = 0;
array.replace(place, 1, " ");
char* c = array.data();
return c;
}