-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandcricket.cpp
788 lines (754 loc) · 15.8 KB
/
handcricket.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
#include<stdio.h>
#include <conio.h>
#include<time.h>
#include <string.h>
#include <ctype.h>
#include<windows.h>
void clrscr(void)
{
system("cls") ; //clear screen.
}
void ShowConsoleCursor(bool showFlag)
{
HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cursorInfo;
GetConsoleCursorInfo(out, &cursorInfo);
cursorInfo.bVisible = showFlag; // set the cursor visibility
SetConsoleCursorInfo(out, &cursorInfo);
}
int wherex()
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE),&csbi);
return csbi.dwCursorPosition.X;
}
int wherey()
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE),&csbi);
return csbi.dwCursorPosition.Y;
}
void gotoxy(short x, short y)
{
COORD pos = {x, y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int getKey(void)
{
int ch = getch();
if (ch == 0 || ch == 224)
ch = 500 + getch();
return ch;
}
int userbattingfirst(int w)
{
int px,py,i,s=0,wkt=0,u,c,cx,cy,ux,uy;
//time_t t;
clrscr();
for(i=0;i<80;i++)
printf("-");
gotoxy(25,2);
printf(" YOU ARE BATTING.\n\n");
for(i=0;i<80;i++)
printf("-");
printf("YOU:- ");
ux=wherex();
uy=wherey();
printf("\nCOMP:-");
cx=wherex();
cy=wherey();
while(1)
{
//printf("\n\nENTER YOUR TURN BETWEEN 1 AND 6:");
//gotoxy(ux,uy);
if(wherex()>75)
{
printf("\n\n\n");
printf("\nYOU:- ");
ux=wherex();
uy=wherey();
printf("\nCOMP:-");
cx=wherex();
cy=wherey();
}
gotoxy(ux,uy);
u=getch();
u-='0';
//scanf("%d",&u);
if(u<1 || u>6)
{
//printf("\n\nWRONG INPUT, PLEASE ENTER BETWEEN 1 AND 6.\n");
printf("\a");
continue;
}
printf("%d",u);
ux=wherex();
uy=wherey();
//srand(time(&t));
c=(rand() % 6)+1;
gotoxy(cx,cy);
printf("%d",c);
cx=wherex();
cy=wherey();
if(c==u)
{
wkt++;
px=wherex();
py=wherey();
gotoxy(25,2);
printf("YOUR SCORE-%3d/%2d ",s,wkt);
gotoxy(px,py);
/*printf("\n\nGOT YOU! YOU ARE OUT!!!!");*/printf("\a");
//printf("\n\nYOU ENTERED %d AND COMPUTER GAVE %d IN ITS TURN.",u,c);
if(wkt==w)
{
printf("\n\n\n\nYOU ARE ALL OUT!\n\n YOUR SCORE WAS %d.\n\nCOMPUTER NEEDS %d RUNS TO WIN",s,s+1);
printf("\n\nPRESS ANY KEY TO CONTINUE\n");
if(getch())
return s;
}
else
{
// printf("\n\nYOUR SCORE IS %d FOR THE LOSS OF %d WICKETS.\n.",s,wkt);
}
}
else
{
// printf("\n\nYOU ENTERED %d AND COMPUTER GAVE %d IN ITS TURN.",u,c);
s+=u;
//printf("\n\nYOUR SCORE IS %d FOR THE LOSS OF %d WICKET(S).\n",s,wkt);
px=wherex();
py=wherey();
gotoxy(25,2);
printf("YOUR SCORE-%3d/%2d ",s,wkt);
gotoxy(px,py);
}
}
}
int computerbattingfirst(int w)
{
int px,py,i,s=0,wkt=0,u,c,ux,uy,cx,cy;
time_t t;
clrscr();
for(i=0;i<80;i++)
printf("-");
gotoxy(25,2);
printf("COMPUTER IS BATTING.\n\n");
for(i=0;i<80;i++)
printf("-");
printf("\nCOMP:-");
cx=wherex();
cy=wherey();
printf("\nYOU:- ");
ux=wherex();
uy=wherey();
while(1)
{
//gotoxy(ux,uy);
// printf("\n\nENTER YOUR TURN BETWEEN 1 AND 6:");
if(wherex()>75)
{
printf("\n\n\n");
printf("\nCOMP:-");
cx=wherex();
cy=wherey();
printf("\nYOU:- ");
ux=wherex();
uy=wherey();
}
gotoxy(ux,uy);
u=getch();
u-='0';
if(u<1 || u>6)
{
/* printf("\n\nWRONG INPUT, PLEASE ENTER BETWEEN 1 AND 6.\n");*/printf("\a");
continue;
}
printf("%d",u);
ux=wherex();
uy=wherey();
//srand(time(&t));
c=(rand() % 6)+1;
gotoxy(cx,cy);
printf("%d",c);
cx=wherex();
cy=wherey();
if(c==u)
{
wkt++;
px=wherex();
py=wherey();
gotoxy(25,2);
printf("COMPUTER'S SCORE-%3d/%2d ",s,wkt);
gotoxy(px,py);
/*printf("\n/nOUT!!!!");*/printf("\a");
// printf("\n\nYOU ENTERED %d AND COMPUTER GAVE %d IN ITS TURN.",u,c);
if(wkt==w)
{
printf("\n\n\n\nCOMPUTER IS ALL OUT!\n\n COMPUTER'S SCORE IS %d.\n\nYOU NEED %d RUNS TO WIN",s,s+1);
printf("\n\nPRESS ANY KEY TO CONTINUE\n");
if(getch())
return s;
}
else
{
/* px=wherex();
py=wherey();
gotoxy(25,2);
printf("COMPUTER'S SCORE-'%3d/%2d ",s,wkt);
gotoxy(px,py);*/
// printf("\n\nCOMPUTER'S SCORE IS %d FOR THE LOSS OF %d WICKET(S).\n.",s,wkt);
}
}
else
{
// printf("\n\nYOU ENTERED %d AND COMPUTER GAVE %d IN ITS TURN.",u,c);
s+=c;
//printf("\n\nCOMPUTER'S' SCORE IS %d FOR THE LOSS OF %d WICKET(S).\n",s,wkt);
px=wherex();
py=wherey();
gotoxy(25,2);
printf("COMPUTER'S SCORE-%3d/%2d ",s,wkt);
gotoxy(px,py);
}
}
}
void computerbattingsecond(int user,int w)
{
int i,px,py,s=0,wkt=0,u,c,ux,uy,cx,cy;
time_t t;
clrscr();
for(i=0;i<80;i++)
printf("-");
gotoxy(25,2);
printf(" COMPUTER IS BATTING.\n\n\n\n");
for(i=0;i<80;i++)
printf("-");
printf("\nCOMP:-");
cx=wherex();
cy=wherey();
printf("\nYOU:- ");
ux=wherex();
uy=wherey();
while(1)
{
//printf("\n\nENTER YOUR TURN BETWEEN 1 AND 6:");
if(wherex()>75)
{
printf("\n\n\n");
printf("COMP:-");
cx=wherex();
cy=wherey();
printf("\nYOU:- ");
ux=wherex();
uy=wherey();
}
gotoxy(ux,uy);
u=getch();
u-='0';
if(u<1 || u>6)
{
/* printf("\n\nWRONG INPUT, PLEASE ENTER BETWEEN 1 AND 6.\n");*/printf("\a");
continue;
}
printf("%d",u);
ux=wherex();
uy=wherey();
// srand(time(&t));
c=(rand() % 6)+1;
gotoxy(cx,cy);
printf("%d",c);
cx=wherex();
cy=wherey();
if(c==u)
{
wkt++;
px=wherex();
py=wherey();
gotoxy(25,2);
printf("COMPUTER'S SCORE-%3d/%2d ",s,wkt);
gotoxy(px,py);
/* printf("\n\n OUT!!!!!");*/printf("\a");
// printf("\n\nYOU ENTERED %d AND COMPUTER GAVE %d IN ITS TURN.",u,c);
if(wkt==w)
{
px=wherex();
py=wherey();
gotoxy(16,4);
if(s==user)
printf(" MATCH TIED ");
else
printf(" YOU WON BY %d RUNS! ",user-s);
gotoxy(px,py);
if(s==user)
printf("\n\n\n\nMATCH TIED! TWO SIDES COULDN'T BE SEPERATED");
else
printf("\n\n\n\nCOMPUTER IS ALL OUT.\n\nYOU WON!\n\nCOMPUTER LOST BY %d RUNS",user-s);
break;
}
else
{
px=wherex();
py=wherey();
gotoxy(16,4);
if(s==user)
printf(" MATCH TIED ");
else
printf("NEED %d MORE RUNS TO WIN WITH %d WICKETS IN HAND ",user-s+1,w-wkt);
gotoxy(px,py);
// printf("\n\nCOMPUTER'S SCORE IS %d. IT NEEDS %d MORE RUNS TO WIN WITH %d WICKET(S) IN HAND.\n.",s,s-user+1,w-wkt);
}
}
else
{
//printf("\n\nYOU ENTERED %d AND COMPUTER GAVE %d IN ITS TURN.\n\n",u,c);
s+=c;
px=wherex();
py=wherey();
gotoxy(25,2);
printf("COMPUTER'S SCORE-%3d/%2d ",s,wkt);
gotoxy(px,py);
if(s>user)
{
printf("\n\n\n\nYOU LOST!\n\nCOMPUTER WON BY %d WICKET(S)",w-wkt);
px=wherex();
py=wherey();
gotoxy(16,4);
printf(" COMPUTER WON BY %d WICKET(S) ",w-wkt);
gotoxy(px,py);
break;
}
px=wherex();
py=wherey();
gotoxy(16,4);
if(s==user)
printf(" MATCH TIED ");
else
printf("NEED %d MORE RUNS TO WIN WITH %d WICKETS IN HAND ",user-s+1,w-wkt);
gotoxy(px,py);
// printf("\n\n COMPUTER NEEDS %d MORE RUNS TO WIN WITH %d WICKET(S) IN HAND.\n.",user-s+1,w-wkt);
}
}
}
void userbattingsecond(int user,int w)
{
int i,px,py,s=0,wkt=0,u,c,ux,uy,cx,cy;
time_t t;
clrscr();
for(i=0;i<80;i++)
printf("-");
gotoxy(25,2);
printf(" YOU ARE BATTING.\n\n\n\n");
for(i=0;i<80;i++)
printf("-");
printf("\nYOU:- ");
ux=wherex();
uy=wherey();
printf("\nCOMP:-");
cx=wherex();
cy=wherey();
while(1)
{
// printf("\n\nENTER YOUR TURN BETWEEN 1 AND 6:");
if(wherex()>75)
{
printf("\n\n\n");
printf("YOU:- ");
ux=wherex();
uy=wherey();
printf("\nCOMP:-");
cx=wherex();
cy=wherey();
}
gotoxy(ux,uy);
u=getch();
u-='0';
if(u<1 || u>6)
{
/*printf("\n\nWRONG INPUT, PLEASE ENTER BETWEEN 1 AND 6.\n");*/printf("\a");
continue;
}
printf("%d",u);
ux=wherex();
uy=wherey();
// srand(time(&t));
c=(rand() % 6)+1;
gotoxy(cx,cy);
printf("%d",c);
cx=wherex();
cy=wherey();
if(c==u)
{
wkt++;
px=wherex();
py=wherey();
gotoxy(25,2);
printf("YOUR SCORE- %3d/%2d ",s,wkt);
gotoxy(px,py);
/*printf("\n\nYOU ARE OUT!!!!!");
printf("\n\nYOU ENTERED %d AND COMPUTER GAVE %d IN ITS TURN.",u,c);*/printf("\a");
if(wkt==w)
{
px=wherex();
py=wherey();
gotoxy(16,4);
if(s==user)
printf(" MATCH TIED ");
else
printf(" YOU LOST! COMPUTER WON BY %d RUNS ",user-s);
gotoxy(px,py);
if(s==user)
printf("\n\n\n\nMATCH TIED! TWO SIDES COULDN'T BE SEPERATED");
else
printf("\n\n\n\nYOU ARE ALL OUT.\n\nCOMPUTER WON!\n\nYOU LOST BY %d RUNS",user-s);
break;
}
else
{
px=wherex();
py=wherey();
gotoxy(16,4);
if(s==user)
printf(" MATCH TIED ");
else
printf("NEED %d MORE RUNS TO WIN WITH %d WICKETS IN HAND ",user-s+1,w-wkt);
gotoxy(px,py);
//printf("\n\nYOUR SCORE IS %d. YOU NEED %d MORE RUNS TO WIN WITH %d WICKET(S) IN HAND.\n.",s,user-s+1,w-wkt);
}
}
else
{
//printf("\n\nYOU ENTERED %d AND COMPUTER GAVE %d IN ITS TURN.\n\n",u,c);
s+=u;
px=wherex();
py=wherey();
gotoxy(25,2);
printf("YOUR SCORE-%3d/%2d ",s,wkt);
gotoxy(px,py);
if(s>user)
{
px=wherex();
py=wherey();
gotoxy(16,4);
printf(" YOU WON BY %d WICKET(S) ",w-wkt);
gotoxy(px,py);
printf("\n\n\n\nYOU WON BY %d WICKET(S)!",w-wkt);
break;
}
px=wherex();
py=wherey();
gotoxy(16,4);
if(s==user)
printf(" MATCH TIED ");
else
printf("NEED %d MORE RUNS TO WIN WITH %d WICKETS IN HAND ",user-s+1,w-wkt);
gotoxy(px,py);
// printf("\n\nYOUR SCORE IS %d. YOU NEED %d MORE RUNS TO WIN WITH %d WICKET(S) IN HAND.\n.",s,user-s+1,w-wkt);
}
}
}
int main()
{
int i,toss,c1,u1,x,s,q,l,w,cx,cy,cyf,r;
time_t t;
ShowConsoleCursor(false);
char a[5],z[][10]={"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","TEN"};
srand(time(&t));
//
for(i=0;i<80;i++)
printf("-");
gotoxy(25,2);
printf(" WELCOME USER\n\n");
for(i=0;i<80;i++)
printf("-");
/* while(1)
{
printf("HOW MANY WICKETS?:");
fflush(stdin);
scanf("%d",&w);
if(w<1 || w>10)
{
printf("\n\aWRONG INPUT. PLEASE ENTER BETWEEN 1 TO 10.\n\n");
continue;
}
break;
}*/printf("\n\nCHOOSE NO OF WICKETS:\n\n\n");
cx=wherex();
cy=wherey();
cyf=cy;
gotoxy(cx+3,cy);
printf("%c",16);
for(i=1;i<=10;i++)
{
gotoxy(cx+5,cy+2*i-2);
printf("%s",z[i-1]);
}
gotoxy(cx+3,cy);
while(1)
{
r=getKey();
if(r==13)
break;
else if(r==580)
{
gotoxy(cx+3,cy);
printf(" ");
gotoxy(cx+3,cy+2);
cy=wherey();
if(cy<=28)
printf("%c",16);
else
{
gotoxy(cx+3,cyf);
cy=cyf;
printf("%c",16);
}
gotoxy(wherex()-1,wherey());
}
else if(r==572)
{
gotoxy(cx+3,cy);
printf(" ");
gotoxy(cx+3,cy-2);
cy=wherey();
if(cy>=10)
printf("%c",16);
else
{
gotoxy(cx+3,28);
cy=28;
printf("%c",16);
}
gotoxy(wherex()-1,wherey());
}
}
cy=wherey();
if(cy==10)
w=1;
else if(cy==12)
w=2;
else if(cy==14)
w=3;
else if(cy==16)
w=4;
else if(cy==18)
w=5;
else if(cy==20)
w=6;
else if(cy==22)
w=7;
else if(cy==24)
w=8;
else if(cy==26)
w=9;
else
w=10;
//printf("\n\n\n\nPRESS ANY KEY TO CONTINUE");
clrscr();
for(i=0;i<80;i++)
printf("-");
gotoxy(19,2);
printf(" LADIES AND GENTLEMAN,ITS TOSS TIME!! \n\n");
for(i=0;i<80;i++)
printf("-");
printf("\n\n");
cx=wherex();
cy=wherey();
cyf=cy;
gotoxy(cx+3,cy);
printf("%c",16);
printf(" EVEN");
gotoxy(cx+3,cy+2);
printf(" ODD");
while(1) /*taking input from user for the toss*/
{
r=getKey();
if(r==13)
break;
else if(r==580)
{
gotoxy(cx+3,cy);
printf(" ");
gotoxy(cx+3,cy-2);
cy=wherey();
if(cy>=7)
printf("%c",16);
else
{
gotoxy(cx+3,9);
cy=9;
printf("%c",16);
}
gotoxy(wherex()-1,wherey());
}
else if(r==572)
{
gotoxy(cx+3,cy);
printf(" ");
gotoxy(cx+3,cy+2);
cy=wherey();
if(cy<=9)
printf("%c",16);
else
{
gotoxy(cx+3,cyf);
cy=cyf;
printf("%c",16);
}
gotoxy(wherex()-1,wherey());
}
}
if(wherey()==7)
toss=0;
else
toss=1;
c1=(rand() % 6)+1;
printf("\n\n\nENTER ANY NO BETWEEN 1 AND 6 FOR THE TOSS:-");
while(1)
{
/*scanf("%d",&u1);*/u1=getch();
u1-='0';
if(u1<1 || u1>6)
/* printf("\nWRONG INPUT, PLEASE ENTER BETWEEN 1 AND 6.\n");*/printf("\a");
else
{
printf("%d",u1);
break;
}
}
//printf("u1=%d",u1);
x=u1+c1;
clrscr();
for(i=0;i<80;i++)
printf("-");
gotoxy(19,2);
printf(" LADIES AND GENTLEMAN,ITS TOSS TIME!! \n\n");
for(i=0;i<80;i++)
printf("-");
if((x%2==toss))
{
printf("\n\nYOU HAVE WON THE TOSS.\n\nWHAT WOULD YOU CHOOSE?\n\n");
cx=wherex();
cy=wherey();
// printf("%d",cy);
cyf=cy;
gotoxy(cx+3,cy);
printf("%c",16);
printf(" BATTING");
gotoxy(cx+3,cy+2);
printf(" BOWLING");
// printf("%d",wherey());
while(1) /*taking input from user for the toss*/
{
r=getKey();
if(r==13)
break;
else if(r==580)//down
{
gotoxy(cx+3,cy);
printf(" ");
gotoxy(cx+3,cy+2);
cy=wherey();
if(cy<=13)
printf("%c",16);
else
{
gotoxy(cx+3,cyf);
cy=cyf;
printf("%c",16);
}
gotoxy(wherex()-1,wherey());
}
else if(r==572)
{
gotoxy(cx+3,cy);
printf(" ");
gotoxy(cx+3,cy-2);
cy=wherey();
if(cy>=11)
printf("%c",16);
else
{
gotoxy(cx+3,13);
cy=13;
printf("%c",16);
}
gotoxy(wherex()-1,wherey());
}
}
if(wherey()==11)
l=1;
else
l=2;
while(1)
{
/*l=getch();
l-='0';
if(l<1 || l>2)
/*printf("\n\nWRONG CHOICE, PLEASE ENTER CAREFULLY.\n");*/
/*else
{
printf("\n%d",l);*/
switch(l)
{
case 1:printf("\n\n\n\nYOU HAVE ELECTED TO BAT FIRST:\n ");
printf("\nPRESS ANY KEY TO CONTINUE");
if(getch())
{
s=userbattingfirst(w);
computerbattingsecond(s,w);
break;
}
case 2: printf("\n\nYOU HAVE ELECTED TO BOWL FIRST:\n ");
printf("\nPRESS ANY KEY TO CONTINUE");
if(getch())
{
s=computerbattingfirst(w);
userbattingsecond(s,w);
break;
}
}
break;
}
}
else
{
printf("\n\nCOMPUTER HAVE WON THE TOSS AND HAS DECIDED TO ");
// srand(time(&t));
q=(rand() % 2);
switch(q)
{
case 0:printf("BAT FIRST.\n");
printf("\nPRESS ANY KEY TO CONTINUE");
if(getch())
{
s=computerbattingfirst(w);
userbattingsecond(s,w);
break;
}
case 1:printf("BOWL FIRST.\n");
printf("\nPRESS ANY KEY TO CONTINUE");
if(getch())
{
s=userbattingfirst(w);
computerbattingsecond(s,w);
break;
}
}
}
printf("\n\nPRESS ANY KEY TO CONTINUE");
if(getch())
{
clrscr();
for(i=0;i<80;i++)
printf("-");
gotoxy(25,2);
printf(" THANK YOU FOR PLAYING!");
gotoxy(23,4);
printf("DEVELOPED BY RIDDHI DUTTA\n\n");
for(i=0;i<80;i++)
printf("-");
printf("\n\nPRESS ANY KEY TO TERMINATE\n");
getch();
}
}