-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconcntrationgame.c
More file actions
74 lines (67 loc) · 2.44 KB
/
concntrationgame.c
File metadata and controls
74 lines (67 loc) · 2.44 KB
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
/*cincentration game*/
//this is a dummy comment if any one sees this pull request for a surprise. (dont worry its not some kind of scam or something)
#include <stdio.h>
void main()
{ int a,b,c,d,e,f,g,h,i,j,k,l,m,x=0;
srand(time(NULL));
printf("wanna play a maths game!\nlet's \tchoose level of difficulty from below.\n ");
do{
printf("\n\t1\teasy\n\t2\tmoderated\n\t3\tdifficult\n\t4\tquit:");
scanf("%d",&a);
b=(rand()%100)+1;
c=(rand()%100)+1;
d=(rand()%100)+1;
e=(rand()%100)+1;
f=(rand()%100)+1;
if(a!=4){
if(a==1){
printf("concentrate on these 3 number:\n %d\t%d\t%d ",b,c,d);
printf("\n ok now ready!!!");
g=time(NULL);
do{
h=time(NULL);
}while((h-g)<5);
system("clear");
printf("\nenter each number with space:");
scanf("%d%d%d",&i,&j,&k);
if(i==b&&j==c&&k==d)
printf("\ncongratulations you got it right");
else
printf("\nsorry! the right numbers were: %d %d %d",b,c,d);
}
else
if(a==2){
printf("concentrate on these 5 number:\n %d\t%d\t%d\t%d\t%d ",b,c,d,e,f);
printf("\n ok now ready!!!");
g=time(NULL);
do{
h=time(NULL);
}while((h-g)<5);
system("clear");
printf("\nenter each number with space:");
scanf("%d%d%d%d%d",&i,&j,&k,&l,&m);
if(i==b&&j==c&&k==d){
printf("\ncongratulations you got it right");}
else
printf("\nsorry! the right numbers were: %d %d %d %d %d",b,c,d,e,f);
}
else
if(a==3){
printf("concentrate on these 3 number:\n %d\t%d\t%d\t%d\t%d ",b,c,d,e,f);
printf("\n ok now ready!!!");
g=time(NULL);
do{
h=time(NULL);
}while((h-g)<2);
system("clear");
printf("\nenter each number with space:");
scanf("%d%d%d%d%d",&i,&j,&k,&l,&m);
if(i==b&&j==c&&k==d){
printf("\ncongratulations you got it right");}
else
printf("\nsorry! the right numbers were: %d %d %d %d %d",b,c,d,e,f);
}
}
}while(a<4);
printf("\nthank you for showing interest");
}