-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDES.CPP
74 lines (72 loc) · 1.15 KB
/
DES.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
68
69
70
71
72
73
74
#include<iostream.h>
#include<conio.h>
#include<process.h>
void controls()
{
cout<<"\n For print movement wasd \n for movement ijkl \n q for clear \n e for exit \n c for colour change ";
cout<<"\n press z for display controls\n ";
}
void main()
{
clrscr();
char d;
controls();
cout<<"Enter design symbol";
cin>>d;
int x,y,c;
y=x=10;
char input;
clrscr();
for(;;)
{ textcolor(c);
input=getch();
switch(input)
{case 'w':gotoxy(x,y-1);
cprintf(" ");
y--;
gotoxy(x,y);
cout<<d;
break;
case 's':gotoxy(x,y+1);
cprintf(" ");
y++;
gotoxy(x,y);
cout<<d;
break;
case 'd':gotoxy(x+1,y);
cprintf(" ");
x++;
gotoxy(x,y);
cout<<d;
break;
case 'a':gotoxy(x-1,y);
cprintf(" ");
x--;
gotoxy(x,y);
cout<<d;
break;
case 'i':y--;
gotoxy(x,y);
break;
case 'k':y++;
gotoxy(x,y);
break;
case 'j':x--;
gotoxy(x,y);
break;
case 'l':x++;
gotoxy(x,y);
break;
case 'c':c++;
break;
case 'p':d=getch();
break;
case 'q':clrscr();
break;
case 'e':exit(0);
case 'z':controls();
break;
}
}
getch();
}