Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- const int MAXLENGTH=100;
- clrscr(){
- int clear;
- clear=0;
- while(clear!=25){
- printf("\n");
- clear++;
- }
- }
- cont(){
- int choice;
- printf("1 - Yes\n"
- "2 - No\n"
- "Do you want to play again?\n");
- scanf("%d", &choice);
- while(choice!=1 && choice!=2){
- printf("Play Again?\n");
- scanf("%d", &choice);
- }
- if(choice==1){
- clrscr();
- main();
- }
- else if(choice==2){
- clrscr();
- return 0;
- }
- }
- cont_cntry(){
- clrscr();
- int c_choice;
- printf("***************************** - Name the Country - *****************************\n");
- printf(" 1 - Asia\n"
- " 2 - North America\n"
- " 3 - Africa\n"
- " 4 - South America\n"
- " 5 - Australia\n"
- " 6 - Europe\n"
- " 7 - Quit\n");
- printf("\nChoose Continent: ");
- scanf("%d", &c_choice);
- if(c_choice==1){
- asia_cntry();
- }
- else if(c_choice==7){
- return 0;
- }
- }
- asia_cntry(){
- clrscr();
- printf("************************** - Name the Country: Asia - **************************");
- printf("Directions: Give the answer of the following questions. Use and underscore '_' instead of a space to separate two or more words answers.");
- printf("\n********************************************************************************\n");
- char *cptl[]={"Kuala lumpur",
- "Singapore",
- "Manila",
- "Bangkok",
- "Yangon",
- "Hanoi",
- "Beijing",
- "Pyongyang",
- "Taipei",
- "Tokyo",
- "Baghdad",
- "Abu Dhabi",
- "New Delhi",
- "Jakarta",
- "Male",
- "Riyadh",
- "Kuwait City",
- "Seoul",
- "Jerusalem",
- "Dili",
- "Sanaa",
- "Damascus",
- "Nicosia",
- "Beirut",
- "Victoria",
- "Doha",
- "Colombo",
- "Astana",
- "Ashgabat",
- "Tashkent",
- "Amman",
- "Ankara",
- "Manama",
- "Dhaka",
- "Dushnabe",
- "Baku",
- "Kathmandu",
- "Muscat",
- "Islamabad",
- "Ulan_Bator",
- "Tehran",
- "Bishkek",
- "Vientiane",
- "Yerevan",
- "Tbilisi",
- "Thimphu",
- "Kabul",
- "Phnom Penh",
- "Bandar Seri Begawan",
- };
- char *cntry[]={"Malaysia",
- "Singapore",
- "Philippines",
- "Thailand",
- "Myanmar",
- "Vietnam",
- "China",
- "North_Korea",
- "Taiwan",
- "Japan",
- "Iraq",
- "United_Arab_Emirates",
- "India",
- "Indonesia",
- "Maldives",
- "Saudi_Arabia",
- "Kuwait",
- "South_Korea",
- "Israel",
- "East_Timor",
- "Yemen",
- "Syria",
- "Cyprus",
- "Lebanon",
- "Hong_Kong",
- "Qatar",
- "Sri_Lanka",
- "Kazakhstan",
- "Turkmenistan",
- "Uzbekistan",
- "Jordan",
- "Turkey",
- "Bahrain",
- "Bangladesh",
- "Tajikistan",
- "Azerbaijan",
- "Nepal",
- "Oman",
- "Pakistan",
- "Mongolia",
- "Iran",
- "Kyrgyzstan",
- "Laos",
- "Armenia",
- "Georgia",
- "Bhutan",
- "Afghanistan",
- "Cambodia",
- "Brunei_Darussalam"
- };
- char *clue_1[]={"M*******",
- "S********",
- "P**********",
- "T*******",
- "M******",
- "V******",
- "C****",
- "N****_K****",
- "T*****",
- "J****",
- "I***",
- "U*****_A***_E*******",
- "I*****",
- "I********",
- "M*******",
- "S****_A*****",
- "K*****",
- "S****_K****",
- "I*****",
- "E***_T*****",
- "Y****",
- "S****",
- "C*****",
- "L******",
- "H***_K***",
- "Q****",
- "S**_L****",
- "K*********",
- "T***********",
- "U*********",
- "J*****",
- "T*****",
- "B******",
- "B*********",
- "T*********",
- "A*********",
- "N****",
- "O***",
- "P*******",
- "M*******",
- "I***",
- "K*********",
- "L***",
- "A******",
- "G******",
- "B*****",
- "A**********",
- "C*******",
- "B*****_D*********"
- };
- char *clue_2[]={"M******a",
- "S*******e",
- "P*********s",
- "T******d",
- "M*****r",
- "V*****m",
- "C***a",
- "N***h_K***a",
- "T****n",
- "J***n",
- "I**q",
- "U****d_A**b_E******s",
- "I***a",
- "I*******a",
- "M******s",
- "S***i_A****a",
- "K****t",
- "S***h_K***a",
- "I****l",
- "E**t_T***r",
- "Y***n",
- "S***a",
- "C****s",
- "L*****n",
- "H**g_K**g",
- "Q***r",
- "S*i_L***a",
- "K********n",
- "T**********n",
- "U********n",
- "J****n",
- "T****y",
- "B*****n",
- "B********h",
- "T********n",
- "A********n",
- "N***l",
- "O**n",
- "P******n",
- "M******a",
- "I**n",
- "K********n",
- "L**s",
- "A*****a",
- "G*****a",
- "B****n",
- "A*********n",
- "C******a",
- "B****i_D********m"
- };
- char guess[MAXLENGTH];
- int ac;
- int bc;
- int compare;
- for(ac=0; ac<49; ac++){
- printf("\n\nWhat country has the capital of ");
- printf("%s?\n\n", cptl[ac]);
- scanf("%s", guess);
- for(bc=0; bc<3; bc++){
- compare=stricmp(guess, cntry[ac]);
- if(bc==0 && compare==0){
- printf("\nCorrect Answer!\n");
- break;
- }
- else if(bc==0 && compare!=0){
- printf("\nTry Again!\n");
- printf("\nClue: %s\n", clue_1[ac]);
- printf("Your Answer: ");
- scanf("%s", guess);
- }
- if(bc==1 && compare==0){
- printf("\nCorrect Answer!\n");
- break;
- }
- else if(bc==1 && compare!=0){
- printf("\nLast Try!\n");
- printf("\nClue: %s\n", clue_2[ac]);
- printf("Your Answer: ");
- scanf("%s", guess);
- }
- if(bc==2 && compare==0){
- printf("\nCorrect Answer!\n");
- }
- else if(bc==2 && compare!=0){
- printf("The correct answer is: %s\n", cntry[ac]);
- break;
- }
- }
- if(compare!=0){
- clrscr();
- cont();
- }
- else if(ac==49 && compare==0){
- break;
- }
- }
- clrscr();
- printf("\n********************************************************************************\n");
- printf("Congratulations! You have completed 'Name the Country: Asia Category'!\n\n\n\n\n\n\n\n");
- printf("\n********************************************************************************\n\n\n\n\n\n\n\n\n");
- cont();
- }
- cont_cptl(){
- printf("***************************** - Name the Capital - *****************************\n");
- int c_choice;
- printf(" 1 - Asia\n"
- " 2 - North America\n"
- " 3 - Africa\n"
- " 4 - South America\n"
- " 5 - Australia\n"
- " 6 - Europe\n"
- " 7 - Quit\n");
- printf("\nChoose Continent: ");
- scanf("%d", &c_choice);
- if(c_choice==1){
- asia_cptl();
- }
- else if(c_choice==7){
- return 0;
- }
- }
- asia_cptl(){
- clrscr();
- printf("\n************************** - Name the Capital: Asia - **************************\n");
- printf("Directions: Give the answer of the following questions. Use and underscore '_' instead of a space to separate two or more words answers.\n");
- printf("\n********************************************************************************\n");
- char *cntry[]={"Philippines",
- "Singapore",
- "Malaysia",
- "Thailand",
- "China",
- "Vietnam",
- "Myanmar",
- "North Korea",
- "Iraq",
- "Japan",
- "Taiwan",
- "United Arab Emirates",
- "Maldives",
- "Indonesia",
- "India",
- "Saudi Arabia",
- "Israel",
- "South Korea",
- "Kuwait",
- "East Timor",
- "Cyprus",
- "Syria",
- "Yemen",
- "Lebanon",
- "Sri Lanka",
- "Qatar",
- "Hong Kong",
- "Kazakhstan",
- "Jordan",
- "Uzbekistan",
- "Turkmenistan",
- "Turkey",
- "Tajikistan",
- "Bangladesh",
- "Bahrain",
- "Azerbaijan",
- "Pakistan",
- "Oman",
- "Nepal",
- "Mongolia",
- "Laos",
- "Kyrgyzstan",
- "Iran",
- "Armenia",
- "Afghanistan",
- "Bhutan",
- "Georgia",
- "Cambodia",
- "Brunei Darussalam"
- };
- char *cptl[]={"Manila",
- "Singapore",
- "Kuala_Lumpur",
- "Bangkok",
- "Beijing",
- "Hanoi",
- "Yangon",
- "Pyongyang",
- "Baghdad",
- "Tokyo",
- "Taipei",
- "Abu_Dhabi",
- "Male",
- "Jakarta",
- "New_Delhi",
- "Riyadh",
- "Jerusalem",
- "Seoul",
- "Kuwait_City",
- "Dili",
- "Nicosia",
- "Damascus",
- "Sanaa",
- "Beirut",
- "Colombo",
- "Doha",
- "Victoria",
- "Astana",
- "Amman",
- "Tashkent",
- "Ashgabat",
- "Ankara",
- "Dushnabe",
- "Dhaka",
- "Manama",
- "Baku",
- "Islamabad",
- "Muscat",
- "Kathmandu",
- "Ulan_Bator",
- "Vientiane",
- "Bishkek",
- "Tehran",
- "Yerevan",
- "Kabul",
- "Thimphu",
- "Tbilisi",
- "Phnom_Penh",
- "Bandar_Seri_Begawan",
- };
- char *clue_1[]={"M*****",
- "S********",
- "K****_L*****",
- "B******",
- "B******",
- "H****",
- "Y*****",
- "P********",
- "B******",
- "T****",
- "T*****",
- "A**_D****",
- "M***",
- "J******",
- "N**_D****",
- "R*****",
- "J********",
- "S****",
- "K*****_C***",
- "D***",
- "N******",
- "D*******",
- "S****",
- "B*****",
- "C******",
- "D***",
- "V*******",
- "A*****",
- "A****",
- "T*******",
- "A*******",
- "A*****",
- "D*******",
- "D****",
- "M*****",
- "B***",
- "I********",
- "M*****",
- "K********",
- "U***_Ba***",
- "V********",
- "B******",
- "T*****",
- "Y******",
- "K****",
- "T******",
- "T******",
- "P****_P***",
- "B*****_S***_B******",
- };
- char *clue_2[]={"M****a",
- "S*******e",
- "K***a_L****r",
- "B*****k",
- "B*****g",
- "H***i",
- "Y****n",
- "P*******g",
- "B*****d",
- "T***o",
- "T****i",
- "A*u_D***i",
- "M**e",
- "J*****a",
- "N*w_D***i",
- "R****h",
- "J*******m",
- "S***l",
- "K****t_C**y",
- "D**i",
- "N*****a",
- "D******s",
- "S***a",
- "B****t",
- "C*****o",
- "D**a",
- "V******a",
- "A****a",
- "A***n",
- "T******t",
- "A******t",
- "A****a",
- "D******e",
- "D***a",
- "M****a",
- "B**u",
- "I*******d",
- "M****t",
- "K*******u",
- "U**n_B***r",
- "V*******e",
- "B*****k",
- "T****n",
- "Y*****n",
- "K***l",
- "T*****u",
- "T*****i",
- "P***m_P**h",
- "B****r_S**i_B*****n",
- };
- char guess[MAXLENGTH];
- int ac;
- int bc;
- int compare;
- for(ac=0; ac<49; ac++){
- printf("\n\nWhat is the captital of ");
- printf("%s?\n\n", cntry[ac]);
- scanf("%s", guess);
- for(bc=0; bc<3; bc++){
- compare=stricmp(guess, cptl[ac]);
- if(bc==0 && compare==0){
- printf("\nCorrect Answer!\n");
- break;
- }
- else if(bc==0 && compare!=0){
- printf("\nTry Again!\n");
- printf("\nClue: %s\n", clue_1[ac]);
- printf("Your Answer: ");
- scanf("%s", guess);
- }
- if(bc==1 && compare==0){
- printf("\nCorrect Answer!\n");
- break;
- }
- else if(bc==1 && compare!=0){
- printf("\nLast Try!\n");
- printf("\nClue: %s\n", clue_2[ac]);
- printf("Your Answer: ");
- scanf("%s", guess);
- }
- if(bc==2 && compare==0){
- printf("\nCorrect Answer!\n");
- }
- else if(bc==2 && compare!=0){
- printf("The correct answer is: %s\n", cptl[ac]);
- break;
- }
- }
- if(compare!=0){
- clrscr();
- cont();
- }
- else if(ac==49 && compare==0){
- break;
- }
- }
- clrscr();
- printf("\n********************************************************************************\n");
- printf("\t\tCongratulations! You have completed 'Name the Capital: Asia Category'!");
- printf("\n********************************************************************************\n\n\n\n\n\n\n\n\n");
- cont();
- }
- int main(){
- printf("********************** - Name The Country/Capital Game - ***********************\n");
- int g_choice;
- printf(" 1 - Name the Country\n"
- " 2 - Name the Capital\n"
- " 3 - Quit\n");
- printf("\nChoose Category: ");
- scanf("%d", &g_choice);
- while(g_choice!=1 && g_choice!=2 && g_choice!=3){
- printf("\nChoose Category: ");
- scanf("%d", &g_choice);
- }
- if(g_choice==1){
- cont_cntry();
- }
- else if(g_choice==2){
- cont_cptl();
- }
- else if(g_choice==3){
- return 0;
- }
- }
Add Comment
Please, Sign In to add comment