-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSHUFFEL.C
85 lines (82 loc) · 1.56 KB
/
SHUFFEL.C
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
#include<stdio.h>
#include<conio.h>
void main()
{
char *message,*p;
int i,x,c1,c=0,flag=0,dd=0;
clrscr();
gotoxy(5,2);
printf(" left to right and right to left message scrolling ");
gotoxy(10,4);
textcolor(LIGHTGRAY);
cprintf(" TYPE THE MESSAGE : ");
message =malloc(200);
p=message;
while(( *message=getchar())!='\n')
{
message++;
c++;
if(c>79)
{
printf("more than I can handle I QUIT ");
getch();
exit();
}
}
*message=NULL;
sorry:
gotoxy(5,5);
cprintf("colors available");
printf("\n");
for(i=1;i<=15;i++)
{
textcolor(i);
cprintf(" COLOUR %d ",i);
printf("\n");
}
printf("enter the corresponding number : ");
scanf("%d",&i);
if(i>15 || i<1)
{
printf(" not valid number..try again ");
getch();
clrscr();
goto sorry;
}
printf(" select scrolling speed (1-FASTEST 10-SLOWEST) ");
scanf("%d",&dd);
if(dd>10 || dd<1)
dd=5;
clrscr();
c1=80-c;
c1=c1/2;
x=c1;
while(!kbhit())
{
gotoxy(1,1);
textcolor(WHITE);
cprintf("hit any key to exit");
textcolor(i);
gotoxy(x,12);
cprintf("%s",p);
if(x+c==80 && flag==1)
{
flag=0;
}
if(x>1 && flag==0)
x--;
if(x==1 && flag==0)
{
flag=1;
x++;
}
if(x+c<80 && flag==1)
{
x++;
}
delay(dd*50);
clrscr();
}
system("cls");
textcolor(LIGHTGRAY);
}