forked from VatsalSin/spaceShooter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cpp
67 lines (67 loc) · 802 Bytes
/
Program.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
#include<iostream>
using namespace std;
int main()
{
int a,x;
cout<<"Welcome\n";
Start:
cout<<"Choose any one of the following:\n";
cout<<"1.Pattern 1\n2.Pattern 2\n";
cin>>a;
switch (a)
{
case 1:
{
for(x=1;x<=5;x++)
{
for(int x1=5;x1>x;x1--)
cout<<" ";
cout<<"*";
for(int x1=1;x1<=2*(x-1)-1;x1++)
cout<<" ";
if(x!=1)
cout<<"*";
cout<<"\n";
}
for(int x=4;x>=1;x--)
{
for(int x1=5;x1>x;x1--)
cout<<" ";
cout<<"*";
for(int x1=1;x1<=2*(x-1)-1;x1++)
cout<<" ";
if(x!=1)
cout<<"*";
cout<<"\n";
}
break;
}
case 2:
{
for(x=1;x<=5;x++)
{
for(int x2=5;x2>x;x2--)
cout<<" ";
for(int y=1;y<=2*x-1;y++)
cout<<"*";
cout<<"\n";
}
for(x=4;x>=1;x--)
{
for(int x2=4;x2>=x;x2--)
cout<<" ";
for(int y=1;y<=2*x-1;y++)
cout<<"*";
cout<<"\n";
}
break;
}
default:
{
cout<<"Wrong choice\n";
goto Start;
break;
}
}
return 0;
}