forked from codewithnick/ascii-art
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dummy.h
98 lines (77 loc) · 1.26 KB
/
dummy.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
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
#include<bits/stdc++.h>
using namespace std;
void C(vector<vector<char>> &v,int col)
{
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
{
//first aur last line
if(i==0||i==6)
{
if((j%7)%3!=0){
v[i][j+col]='$';}
else {v[i][j+col]=' ';}
}
//second nd second last line
if(i==1||i==5)
{
if(((j)%7)<2||((j)%7)>4) {v[i][j+col]='$';}
else {v[i][j+col]=' ';}
}
// rest
if(i==2||i==4||i==3)
{
if(((j)%7)<2) { v[i][j+col]='$';}
else {v[i][j+col]=' ';}
}
}
}
}
void D(vector<vector<char>> &v,int col)
{
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
{
if(i==0||i==6)
{
if(((j)%7)!=0&&((j)%7)%3==0) v[i][j+col]=' ';
else v[i][j+col]='%' ;
}
else{
if(((j)%7)==1||((j)%7)==2||((j)%7)==5||((j)%7)==6)
v[i][j+col]='%';
else
v[i][j+col]=' ';
}
}
}
}
int main()
{
string str;
cin>>str;
int n=(str.length()*7)+((str.length()-1)*2);
vector<vector<char>>v(7,vector<char>(n,' '));
for(int i=0;i<str.size();i++)
{
if(str[i]=='C')
{
int col=(i!=0)?((i*7)+i+i):0;
C(v,col);
}
else{
int col=(i!=0)?((i*7)+i+i):0;
D(v,col);
}
}
for(int i=0;i<7;i++)
{
for(int j=0;j<v[0].size();j++)
{
cout<<v[i][j];
}
cout<<endl;
}
}