int loopMenu_Maths() { char options[11]; std::string fail; options[0]='1'; options[1]='2'; options[2]='3'; options[3]='4'; options[4]='5'; options[5]='6'; options[6]='7'; options[7]='8'; options[8]='9'; options[9]='a'; options[10]='x'; bool Exit=false; do{ showMenu_Maths(); std::string choice = loopMenu(options,11); //std::cout << choice << std::endl; if (choice=="1") { if(add()) std::cout << "Function Failed"; } else if (choice=="2") { if(subtract()) std::cout << "Function Failed"; } else if (choice=="3") { if(multiply()) std::cout << "Function Failed"; } else if (choice=="4") { if(divide()) std::cout << "Function Failed"; } else if (choice=="5") { if(intercept()) std::cout << "Function Failed"; } else if (choice=="6") { if(threevector()) std::cout << "Function Failed"; } else if (choice=="7") { if(rootsOfQuadratic()) std::cout << "Function Failed"; } else if (choice=="8") { if(swapInterface(fail)) std::cout << "Function Failed - " << fail; } else if (choice=="9") { if(bubbleSortInterface(fail)) std::cout << "Function Failed - " << fail; } else if (choice=="a") { if(algorithms()) std::cout << "Function Failed - " << fail; } else if (choice=="x") { Exit=true; } }while(false==Exit); //delete [] options;*/ return 0; }
char encode(word table[]) { alreadyEncoded = 1; for(int i = 0; i < 10; i++) { printf("Enter the %d English word: ", i+1); scanf("%s", table[i].english); printf("Enter its translation in French: "); scanf("%s", table[i].french); fprintf(fichier, "%s\n", table[i].english); fprintf(fichier, "%s\n", table[i].french); } fclose(fichier); loopMenu(table); }
void drawMenu() { ALLEGRO_FONT *openSans62; openSans62 = al_load_ttf_font("../fonts/OpenSans-Light.ttf", 62, 0); if(!openSans62) error("al_load_font()"); al_draw_text(openSans62, WHITE, SCREEN_WIDTH*0.1, SCREEN_HEIGHT*0.1, 0, "Pong"); al_draw_text(openSans12, WHITE, SCREEN_WIDTH*0.1, SCREEN_HEIGHT*0.5, 0, "1) Solo"); al_draw_text(openSans12, WHITE, SCREEN_WIDTH*0.1, SCREEN_HEIGHT*0.6, 0, "2) Multiplayer"); al_flip_display(); loopMenu(); };
int loopMenu_AdvPhysics() { char options[5]; std::string fail; options[0]='1'; options[1]='2'; options[2]='3'; options[3]='4'; options[4]='x'; bool Exit=false; do{ showMenu_AdvPhysics(); std::string choice = loopMenu(options,5); //std::cout << choice << std::endl; if (choice=="1") { if(meanMassOfRandParticles()) std::cout << "Function Failed"; } else if (choice=="2") { if(muTwoParticle()) std::cout << "Function Failed"; } else if (choice=="3") { if(readPDGDatbase()) std::cout << "Function Failed"; } else if (choice=="4") { if(runTwoBodyGenerator()) std::cout << "Function Failed"; } else if (choice=="x") { Exit=true; } }while(false==Exit); //delete [] options;*/ return 0; }
int main() { word table[10]; loopMenu(table); return 0; }