game of bollywood


SUBMITTED BY: Guest

DATE: Aug. 24, 2012, 11:56 a.m.

FORMAT: C++

SIZE: 2.5 kB

HITS: 1932

  1. Game of Bollywood
  2. # include<iostream.h>
  3. # include<stdio.h>
  4. # include<conio.h>
  5. # include<string.h>
  6. # include<dos.h>
  7. # include<process.h>
  8. static int cnt=0;
  9. void main()
  10. {
  11. clrscr();
  12. char film[150],ch,film2[150];
  13. int choi,len,res=0,dig=0,j,count=0,len1,flag=1,p;
  14. cout<<"Enter 1 For HOLLYWOOD & 2 For BOLLYWOOD ";
  15. cin>>choi;
  16. cout<<"
  17. ENTER THE NAME OF THE FILM
  18. ";
  19. gets(film);
  20. len=strlen(film);
  21. len1=len;
  22. clrscr();
  23. flushall();
  24. gotoxy(15,10);
  25. if(choi==1)
  26. cout<<"HOLLYWOOD
  27. ";
  28. else
  29. cout<<"BOLLYWOOD
  30. ";
  31. for(int i=0;i<len1;i++)
  32. {
  33. gotoxy(15+i,12);
  34. switch(film[i])
  35. {
  36. case 'a':cout<<"a";len--;film2[cnt]='a';cnt++;break;
  37. case 'e':cout<<"e";len--;film2[cnt]='e';cnt++;break;
  38. case 'i':cout<<"i";len--;film2[cnt]='i';cnt++;break;
  39. case 'o':cout<<"o";len--;film2[cnt]='o';cnt++;break;
  40. case 'u':cout<<"u";len--;film2[cnt]='u';cnt++;break;
  41. case '.':cout<<".";len--;break;
  42. case ' ':cout<<" ";len--;break;
  43. default:cout<<"_";
  44. }
  45. }
  46. gotoxy(15,15);
  47. cout<<"Now Guess The Film ";
  48. while(flag==1)
  49. {
  50. p=0;
  51. dig=0;
  52. gotoxy(37,15);
  53. cin>>ch;
  54. film2[cnt]=ch;
  55. if(cnt>=1)
  56. {
  57. for(int k=0;k<cnt;k++)
  58. {
  59. if(film2[k]==ch)
  60. p=1;
  61. }
  62. }
  63. cnt++;
  64. for(j=0;j<len1;j++)
  65. {
  66. if(film[j]==ch)
  67. {
  68. dig++;
  69. count++;
  70. if(p==1)
  71. {
  72. count--;
  73. }
  74. gotoxy((15+j),12);
  75. cout<<ch;
  76. if(count==len)
  77. {
  78. gotoxy(15,17);
  79. cout<<"CONGRATS YOU WON! BY "<<(9-res)<<" POINTS";
  80. getch();
  81. exit(0);
  82. }
  83. }
  84. }
  85. if(dig==0)
  86. {
  87. if(p==1)
  88. {res--;}
  89. gotoxy((15+res),10);
  90. cout<<ch;
  91. res++;
  92. if(res==9)
  93. {
  94. flag=0;
  95. gotoxy(15,17);
  96. cout<<"SORRY YOU LOST THE NAME OF FILM WAS "<<film;
  97. getch();
  98. }
  99. }
  100. }
  101. }

comments powered by Disqus