-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc-teksgerak.h
39 lines (37 loc) · 927 Bytes
/
c-teksgerak.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
/// Program teksgerak
/// main source https://steemit.com/utopian-io/@cuthamza/steps-to-create-animated-text-in-c-programming-language
///
#ifndef TEKSGERAK
#define TEKSGERAK
int main_teksgerak()
{
int x; double y;
char text1[]= "\n\t Halo! Selamat Datang! ";
char text2[]= "\n\t Senang berjumpa dengan Anda!";
char text3[]= "\n\t :)\n\n";
for(x=0; text1[x]!='\0'; x++) {
printf("\x1B[5;33m%c\x1B[0m",text1[x]);
fflush(stdout);
usleep(60000);
}
for(x=0; text2[x]!='\0'; x++) {
printf("%c",text2[x]);
fflush(stdout);
usleep(40000);
}
for(x=0; text3[x]!='\0'; x++) {
printf("%c",text3[x]);
fflush(stdout);
usleep(100000);
}
/// Modifikasi while jadi if
if (1)
{
printf("Hello world");
fflush(stdout);
sleep(1);//delay the control flow
for(x=0;x<15;x++){printf("\033[D");}
}
return 0;
}
#endif