You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2650 lines
92 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <stdlib.h>
  4. #include <ctype.h>
  5. #include <string.h>
  6. #include <stdbool.h>
  7. #include <unistd.h>
  8. #include "quizproject.h"
  9. char answers[NUM_QUESTIONS] = {'B', 'A', 'A','B','A'};
  10. int* randomNumber() {
  11. srand(time(NULL));
  12. int k = 0, p;
  13. static int arr[100];
  14. while(k<100){
  15. int num =rand()%100;
  16. for (p = 0; p < k; p++){
  17. if(arr[p]==num){
  18. break;
  19. }
  20. }
  21. if(p==k){
  22. arr[k++]=num;
  23. }
  24. }
  25. return arr;
  26. }
  27. //------------Math_quiz_begin------------
  28. void math_instruction(){
  29. printf("\t\n\n------------------------Instructions-------------------------\n\n");
  30. printf("\tThere are two Math Quiz Game. The first is Easy-Math and the second is Hard-Math\n");
  31. printf("\tFor Easy-Math, you can choose a number between 1 and 5 to randomly generate a question.\n");
  32. printf("\tA wrong answer means, you lose and you are out of the quiz Game.\n");
  33. printf("\tIf you choose any other character or number apart from numbers between 1 and 5, you are out of the Game\n");
  34. printf("\tIn the Hard-Math quiz, You are presented 10 questions\n\n");
  35. printf("\t\n\n-------------------------------------------------\n\n");
  36. printf( "\t\n\n !! Wish you all the best !! \n\n " );
  37. printf("\t......................................................\n" );
  38. printf( "\t\n Do you still wish to continue playing ? If yes, then press 1. Else, press 0 : " );
  39. int input1;
  40. scanf("%d", &input1);
  41. if( input1 == 1 ){
  42. math_enter_game();
  43. } else{
  44. printf("\t\t-------------------------------------------------------\n");
  45. printf("\t\t Sorry to see you go.\n ");
  46. printf("\t\t-------------------------------------------------------\n\n");
  47. }
  48. }
  49. void math_choose_game() {
  50. printf("\t\t-------------------------------------------------------\n");
  51. printf("\t\t There are Two type of Math quiz\n");
  52. printf("\t\t A]. Easy-Math\n");
  53. printf("\t\t B]. Hard-Math\n");
  54. printf("\t\t-------------------------------------------------------\n\n");
  55. printf("\t\t Type any key and press enter to exit\n");
  56. printf("\t\t Choose either A or B to begin the quiz you want\n");
  57. char choose;
  58. scanf(" %c", &choose);
  59. choose = toupper(choose);
  60. if (choose == 'A'){
  61. math_display_choice();
  62. } else if(choose == 'B'){
  63. e_math_ques();
  64. } else {
  65. printf("\t\t-------------------------------------------------------\n");
  66. printf("\t\t Sorry to see you go.\n ");
  67. printf("\t\t-------------------------------------------------------\n\n");
  68. }
  69. }
  70. void math_choose_question(int num1) {
  71. char choose [][100] = {
  72. "what is 1 + 1\n",
  73. "what is 4 + 3\n",
  74. "what is 4 * 8\n",
  75. "what is ((6*8)/4)+2\n",
  76. "what is 1 + 3\n",
  77. "what is 5 + 3\n",
  78. "what is 4 * 10\n",
  79. "what is ((6*2)/2)+2\n",
  80. "what is 5-7+12\n", //10
  81. "what is 4 + 3 * 2\n",//10
  82. "what is 4 * 8 - 10\n", //22
  83. "what is ((6*6)/4)+3\n", //12
  84. "what is 1 + 21\n",//22
  85. "what is 5 + 75\n",//80
  86. "what is 4 * 11\n",//44
  87. "what is 56 * 0\n",// 0
  88. "what is 1 + 5\n", //6
  89. "what is 4 + 90\n",//94
  90. "what is 4 * 4\n",//16
  91. "what is ((6*4)/4)\n", //6
  92. "what is 56 + 3\n",//59
  93. "what is 5 + 5\n",//10
  94. "what is 4 * 5\n", //20
  95. "what is ((6*2)/2)+5\n",//11
  96. "what is 23 + 2\n",//25
  97. "what is 4 + 23\n",//27
  98. "what is 3 * 7\n",//21
  99. "what is ((6*7)/6)\n",//7
  100. "what is 1 + 85\n",//86
  101. "what is 5 + 45\n",//50
  102. "what is 4 * 20\n",//80
  103. "what is (5/2)*4\n"//10
  104. };
  105. srand(time(NULL));
  106. int k = 0, p;
  107. static int arr[32];
  108. while(k<32) {
  109. int num = rand() % 32;
  110. for (p = 0; p < k; p++) {
  111. if (arr[p] == num) {
  112. break;
  113. }
  114. }
  115. if (p == k) {
  116. arr[k++] = num;
  117. }
  118. }
  119. int num2 = arr[num1];
  120. printf("%s", choose[num2]);
  121. }
  122. int math_answer(int num1) {
  123. int ans[]= {
  124. 2,
  125. 7,
  126. 32,
  127. 14,
  128. 4,
  129. 8,
  130. 40,
  131. 8,
  132. 10,
  133. 10,
  134. 22,
  135. 12,
  136. 22,
  137. 80,
  138. 44,
  139. 0,
  140. 6,
  141. 94,
  142. 16,
  143. 6,
  144. 59,
  145. 10,
  146. 20,
  147. 11,
  148. 25,
  149. 27,
  150. 21,
  151. 7,
  152. 86,
  153. 50,
  154. 80,
  155. 10
  156. };
  157. srand(time(NULL));
  158. int k = 0, p;
  159. static int arr[32];
  160. while(k<32) {
  161. int num = rand() % 32;
  162. for (p = 0; p < k; p++) {
  163. if (arr[p] == num) {
  164. break;
  165. }
  166. }
  167. if (p == k) {
  168. arr[k++] = num;
  169. }
  170. }
  171. int num2 = arr[num1];
  172. return ans[num2];
  173. }
  174. void math_display_choice(){
  175. int user_answer, ques_ans,repeat = 0;
  176. printf("Choose a number between 1 and 4(game ends with invalid number or wrong answer): ");
  177. scanf("%d", &user_answer);
  178. user_answer = user_answer-1;
  179. int quiz_answer = math_answer(user_answer);
  180. while (user_answer != 4 || repeat) {
  181. quiz_answer = math_answer(user_answer);
  182. switch(user_answer){
  183. case 0: case 1: case 2: case 3:
  184. math_choose_question(user_answer);
  185. printf("Answer: ");
  186. scanf("%d", &ques_ans);
  187. repeat =1;
  188. break;
  189. default:
  190. printf("Invalid choice!\n");
  191. }
  192. if(quiz_answer == ques_ans){
  193. printf("Correct!\n");
  194. } else {
  195. printf("Wrong!\n");
  196. break;
  197. }
  198. if (repeat) {
  199. repeat = 0;
  200. printf("Choose a number between 1 and 4(game ends with invalid number or wrong answer): ");
  201. scanf("%d", &user_answer);
  202. user_answer = user_answer-1;
  203. }
  204. }
  205. }
  206. void e_math_ques() {
  207. char e_math[][140] = {
  208. "What is the value of x if the equation 2x + 3 = 7 is solved for x?",
  209. "Simplify the expression 4x^2 - 9x + 6.",
  210. "What is the slope of the line y = 2x + 3?",
  211. "What is the equation of the line that passes through the points (3,4) and (7,10)?",
  212. "Simplify the expression 3(2x + 4) - 5",
  213. "What is the equation of the line that is perpendicular to the line y = 2x + 3 and passes through the point (5,7)?",
  214. "What is the value of x if the equation x^2 + 4x + 4 = 0 is solved using the quadratic formula?",
  215. "Simplify the expression 2(x + 3) + 4(x + 2).",
  216. "What is the equation of the circle with center (3,4) and radius 5?",
  217. "Solve for x: x + 4 = 10.",
  218. };
  219. char e_math_possible[][140] = {
  220. "[a]. x = 2 [b]. x = 4 [c]. x = 5 [d]. x = 1",
  221. "[a]. 4x^2 - 4x + 6 [b]. 4x^2 - 3x + 5 [c]. 3x^2 - 3x + 6 [d]. 4x^2 - 3x + 6",
  222. "[a]. 1 [b]. 2 [c]. 5 [d]. 4",
  223. "[a].y = 3x - 2. [b]. y = 2x - 1 [c]. y = 3x - 3 [d]. y = 2x - 2",
  224. "[a]. 3x - 2. [b]. 6x + 1 [c]. 6x + 7 [d]. 2x - 2",
  225. "[a].y = 0.5x + 8.5 [b]. y = -0.5x + 8.5 [c]. y = 0.5x - 8.5 [d]. y = -0.5x - 8.5",
  226. "[a].x = -2 or x = -2 [b]. x = -2 or x = 2 [c]. x = 2 or x = 2 [d]. x = -1 or x = -2",
  227. "[a]. 3x + 2. [b]. 6x + 13 [c]. 6x + 14 [d]. 2x - 2",
  228. "[a]. (x - 3)^2 + (y - 4)^2 = 2.5 [b]. (x - 2)^2 + (y - 4)^2 = 25 [c]. (x - 3)^2 + (y - 2)^2 = 25 [d]. (x - 3)^2 + (y - 4)^2 = 25",
  229. "[a]. x = 2 [b]. x = 6 [c]. x = 5 [d]. x = 7",
  230. };
  231. char e_math_solution[10] = {
  232. 'A',
  233. 'D',
  234. 'B',
  235. 'D',
  236. 'C',
  237. 'B',
  238. 'A',
  239. 'C',
  240. 'D',
  241. 'B',
  242. };
  243. char e_math_statement[][100] = {
  244. "Solution: x = 2",
  245. "Solution: 4x^2 - 9x + 6 = 4x^2 - 9x + 6x - 6x + 6 = 4x^2 - 3x + 6",
  246. "Solution: The slope of the line is 2.",
  247. "Solution: The equation of the line is y = 2x - 2.",
  248. "Solution: 3(2x + 4) - 5 = 6x + 12 - 5 = 6x + 7",
  249. "Solution: The equation of the line is y = -0.5x + 8.5.",
  250. "Solution: x = -2 or x = -2",
  251. "Solution: 2(x + 3) + 4(x + 2) = 2x + 6 + 4x + 8 = 6x + 14",
  252. "Solution: The equation of the circle is (x - 3)^2 + (y - 4)^2 = 25.",
  253. "Solution: x = 6.",
  254. };
  255. int* randArr = randomNumber();
  256. int arr[10];
  257. int p = 0;
  258. for(int i = 0; i < 100; i++){
  259. if(randArr[i] < 10){
  260. arr[p] = randArr[i];
  261. p++;
  262. }
  263. }
  264. e_math_print(e_math, e_math_possible, e_math_solution, e_math_statement, arr);
  265. }
  266. void e_math_print(char e_ques[][140], char e_poss[][140], char e_math_solution[], char e_math_statement[][100], int arr[]){
  267. int i = 0;
  268. while(i < 10){
  269. int arr1 = arr[i];
  270. printf("[%d]. %s\n", i+1, e_ques[arr1]);
  271. printf(" %s\n",e_poss[arr1]);
  272. printf(" Answer: ");
  273. char user_answer;
  274. scanf(" %c", &user_answer);
  275. user_answer = toupper(user_answer);
  276. if (user_answer == e_math_solution[arr1]) {
  277. printf("Correct!\n");
  278. } else {
  279. printf("Wrong!\n");
  280. printf("%s\n\n", e_math_statement[arr1]);
  281. }
  282. i++;
  283. }
  284. }
  285. void math_enter_game() {
  286. int choice = 0;
  287. printf("\t\t-------------------------------------------------------\n");
  288. printf("\t\t Please press 1 to enter Quiz-game \n ");
  289. printf("\t\t Please press 2 to see Instruction\n ");
  290. printf("\t\t Please press 0 to Exit \n");
  291. printf("\t\t-------------------------------------------------------\n\n");
  292. printf("Enter your choice: ");
  293. scanf("%d", &choice);
  294. switch (choice){
  295. // in order to start the game
  296. case 1:
  297. math_choose_game();
  298. break;
  299. case 2:
  300. math_instruction();
  301. break;
  302. default:
  303. printf("\t\t-------------------------------------------------------\n");
  304. printf("\t\t Sorry to see you go.\n ");
  305. printf("\t\t-------------------------------------------------------\n\n");
  306. }
  307. }
  308. //------------Math_quiz_end--------------
  309. //-------smart_brain_quiz_begin----------
  310. void e_press_key_start() {
  311. char e_start_game;
  312. scanf(" %c", &e_start_game);
  313. e_start_game = toupper(e_start_game);
  314. }
  315. void hint_anagram(int hint_num) {
  316. char hint_questions[][100] = {
  317. "d_v_l_p_e_t",
  318. "i_t_r_a_i_nal",
  319. "p_l__im_ge",
  320. "o_e__t_on",
  321. "p_p_la__on",
  322. "p__g__ss",
  323. "c_a__en_e",
  324. "e_ce__en_e",
  325. "al_o_ati__"
  326. };
  327. printf("Here is your hint: %s\n",hint_questions[hint_num]);
  328. }
  329. void e_display_instruction() {
  330. printf("\t\t-------------------------------------------------------\n");
  331. printf("\t\t To start this Quiz, here are the instructions\n");
  332. printf("\t\t------------------------------------------------------\n\n");
  333. printf("\t\t>>In the first, second Round, you answer True or false questions.<<\n");
  334. printf("\t\t>>In the third Round, you answer questions which test your General knowledge.<< \n");
  335. printf("\t\t-------------------------------------------------------\n\n");
  336. printf("\t\t>>Press any key and enter to begin the Quiz.<<\n\n");
  337. e_press_key_start();
  338. }
  339. void e_usr_answr(char question[][100], char ans[], int initial, int end, int randChar[]){
  340. int i;
  341. char user_answer;
  342. for(i = initial; i < end; i++) {
  343. int rNum = randChar[i];
  344. printf("[%d]. %s", i + 1, question[rNum]);
  345. scanf(" %c", &user_answer);
  346. user_answer = toupper(user_answer);
  347. while (user_answer != 'T' || user_answer != 'F' ){
  348. if(user_answer == 'T' || user_answer == 'F') {
  349. break;
  350. } else {
  351. printf("Input is invalid! Enter 'T' for true or 'F' for false [T/F]:\n");
  352. scanf(" %c", &user_answer);
  353. user_answer = toupper(user_answer);
  354. }
  355. }
  356. bool ans1 = e_true_false(user_answer);
  357. if(ans1 == ans[rNum]) {
  358. score++;
  359. if(i > 2) {
  360. track_r2_score++;
  361. }
  362. correct(score);
  363. } else{
  364. wrong(score);
  365. }
  366. }
  367. }
  368. void e_t_f_printQuestions(char askquestion[][100],char answers[], int charArr[]) {
  369. int track_rounds = 0;
  370. while(track_rounds < 1){
  371. printf("\t\t---------------------------Round1-----------------------------\n");
  372. printf("\t\t >>In this round you will be presented with 3 questions.<<\n");
  373. printf("\t\t>>You need to answer 2 questions correctly to move to Round 2<<\n");
  374. printf("\t\t--------------------------------------------------------------\n\n");
  375. int init = 0, end = 3;
  376. e_usr_answr(askquestion,answers, init, end,charArr);
  377. if(score < 2) {
  378. break;
  379. } else {
  380. printf("\t\t---------------------------Round2-----------------------------\n");
  381. printf("\t\t >>In this round you will be presented with 2 questions.<<\n");
  382. printf("\t\t>>A false answer to any questions means you lose and out of the Game<<\n");
  383. printf("\t\t--------------------------------------------------------------\n\n");
  384. init = 3, end = 5;
  385. e_usr_answr(askquestion,answers, init, end, charArr);
  386. }
  387. track_rounds++;
  388. }
  389. }
  390. void e_ask_questions(void) {
  391. char e_t_f_question[][100] = {
  392. "Mount Everest is the tallest mountain in the world:\n [T/F]: ",
  393. "USA has the largest population in the world:\n [T/F]: ",
  394. "Russia is the largest country by land size:\n [T/F]: ",
  395. "Donald trump is the current president of USA:\n [T/F]: ",
  396. "Cheese are made from plants:\n [T/F]: ",
  397. "Tomato ist a fruit:\n [T/F]: ",
  398. "Men have 2 X chromosomes:\n [T/F]: "
  399. };
  400. char e_t_f_solution[100] = {
  401. true,
  402. false,
  403. true,
  404. false,
  405. false,
  406. true,
  407. false
  408. };
  409. int* randChar = randomNumber();
  410. int charArr[7];
  411. int p1 = 0;
  412. for(int k = 0; k < 100; k++) {
  413. if (randChar[k] < 7) {
  414. charArr[p1] = randChar[k];
  415. p1++;
  416. }
  417. }
  418. e_t_f_printQuestions(e_t_f_question, e_t_f_solution, charArr);
  419. }
  420. bool e_true_false(char choice) {
  421. if (choice == 'T') {
  422. return true;
  423. } else if(choice == 'F') {
  424. return false;
  425. } else {
  426. return -1;
  427. }
  428. }
  429. void e_questions_r3(void) {
  430. char questions[][100] ={
  431. "Which country started WW3?\n",
  432. "What is the strongest Metal in the world?\n",
  433. "which holy City do Muslim go on a pilgrimage to? \n"
  434. };
  435. char answers [][100] = {
  436. "germany",
  437. "tungsten",
  438. "mecca"
  439. };
  440. e_printout_r3 (questions, answers);
  441. }
  442. void e_printout_r3 (char question[][100], char answers[][100]) {
  443. int i;
  444. char user_answer[100];
  445. printf("\t\t---------------------------Round3-----------------------------\n");
  446. printf("\t\t >>In this round you will be presented with 3 questions.<<\n");
  447. printf("\t\t--------------------------------------------------------------\n\n");
  448. for(i = 0; i < 3; i++) {
  449. int k = 0;
  450. printf("[%d]. %s",i+6,question[i]);
  451. printf(" Your answer: ");
  452. scanf("%s", user_answer);
  453. int num = strlen(user_answer);
  454. char ans[50];
  455. for (int j = 0; j < 9; j++) {
  456. ans[j] = answers[i][j];
  457. }
  458. for (int j = 0; j < strlen(ans); j++) {
  459. if (ans[j] == tolower(user_answer[j])){
  460. k++;
  461. }
  462. }
  463. if (k == strlen(ans) && num == strlen(ans)) {
  464. score++;
  465. correct(score);
  466. } else {
  467. wrong(score);
  468. }
  469. }
  470. }
  471. void guess_word_questions() {
  472. char guess_words[][100] = {
  473. "fi__s__d",
  474. "b__ke_",
  475. "p__si__",
  476. "_i__ons__",
  477. "_vi_e__e",
  478. "de__l__me__",
  479. "w___i_e",
  480. "r___d___e",
  481. "se_t_em__t",
  482. "___lia___ta_y",
  483. "m_n_s__r__s",
  484. "si__if_ca__e",
  485. "ch__le_g_"
  486. };
  487. char guess_solution [][100] = {
  488. "nihe",
  489. "uct",
  490. "hycs",
  491. "wscin",
  492. "ednc",
  493. "veopnt",
  494. "ebst",
  495. "esienc",
  496. "tlen",
  497. "parmenr",
  498. "oateie",
  499. "gninc",
  500. "alne"
  501. };
  502. char word_guessed[][100] = {
  503. "finished",
  504. "bucket",
  505. "physics",
  506. "wisconsin",
  507. "evidence",
  508. "development",
  509. "website",
  510. "residence",
  511. "settlement",
  512. "Parliamentary",
  513. "monasteries",
  514. "significance",
  515. "challenge"
  516. };
  517. int* randArr0 = randomNumber();
  518. int arr0[13];
  519. int p = 0;
  520. for(int i = 0; i < 100; i++){
  521. if(randArr0[i] < 13){
  522. arr0[p] = randArr0[i];
  523. p++;
  524. }
  525. }
  526. print_guess_word_question (guess_words, guess_solution,word_guessed, arr0);
  527. }
  528. void print_guess_word_question (char guessWord[][100], char guessSolution[][100],char guessedWord[][100], int randArr[]){
  529. printf("\t\t---------------------------Round4-----------------------------\n\n");
  530. printf("\t\t >>You have to guess what word it is by filling\n");
  531. printf(" in the empty space<<\n\n");
  532. printf("\t\t-------------------------------------------------------------\n\n");
  533. for (int j = 0; j < 4; j ++) {
  534. int runNum = randArr[j];
  535. char usr_ans[100];
  536. int k = 0;
  537. printf("[%d]. Guess the word by finding the missing Letters:\n %s: \n",j+1, guessWord[runNum]);
  538. printf(" Your answer: ");
  539. scanf("%s",usr_ans);
  540. char arr[30];
  541. for(int p = 0; p < 30; p++) {
  542. arr[p] = guessSolution[runNum][p];
  543. if (guessSolution[runNum][p] == '\0') {
  544. break;
  545. }
  546. }
  547. for (int i = 0; i < strlen(arr); i++) {
  548. if(usr_ans[i] == arr[i]) {
  549. k++;
  550. }
  551. }
  552. if (k == strlen(arr) && strlen(usr_ans) == strlen(arr)) {
  553. score++;
  554. printf("Correct!\nYou have %d points\n",score);
  555. printf("You guessed right! The word is rightfully, %s!\n\n", guessedWord[runNum]);
  556. } else {
  557. printf("Wrong!\nYou have %d points\n", score);
  558. }
  559. }
  560. }
  561. void e_printout(char print_out_questn[][100], char questions[][100],int randArr[]) {
  562. printf("\t\t---------------------------Round5-----------------------------\n\n");
  563. printf("\t\t >>You are represented with an Anagram in each question.<<\n");
  564. printf(" >>Determine what word it is.<<\n\n");
  565. printf("\t\t-------------------------------------------------------------\n\n");
  566. char usr_ans[100];
  567. for(int i = 0; i < 4; i++) {
  568. int rNum = randArr[i];
  569. printf("[%d] Guess the correct word for this anagram: %s\n", i+1, print_out_questn[rNum]);
  570. printf("Answer: ");
  571. scanf("%s", usr_ans);
  572. for(int j = 0; j < strlen(usr_ans); j++) {
  573. if (toupper(usr_ans[j]) == 'H' && strlen(usr_ans) == 1) {
  574. hint_anagram(rNum);
  575. printf("Answer: ");
  576. scanf("%s", usr_ans);
  577. }
  578. }
  579. int p = 0;
  580. while(p < strlen(usr_ans)) {
  581. usr_ans[p] = tolower(usr_ans[p]);
  582. p++;
  583. }
  584. int k = 0;
  585. for (int j = 0; j < strlen(print_out_questn[rNum]); j ++){
  586. if(usr_ans[j] == questions[rNum][j]) {
  587. k++;
  588. }
  589. }
  590. if (k == strlen(print_out_questn[rNum]) && strlen(usr_ans) == strlen(print_out_questn[rNum])) {
  591. score++;
  592. printf("Correct!\nYou have %d points\n", score);
  593. } else {
  594. printf("Wrong!\n");
  595. printf("The word is: %s\n", questions[rNum]);
  596. }
  597. }
  598. }
  599. void e_anagram_questions() {
  600. char questions[][100] = {
  601. "development",
  602. "international",
  603. "pilgrimage",
  604. "operation",
  605. "population",
  606. "progress"
  607. };
  608. char print_questions[100][100];
  609. int *charNum = randomNumber();
  610. char arr[100];
  611. for (int i = 0; i < 6; i++) {
  612. for(int j = 0; j < 100; j++) {
  613. arr[j] = questions[i][j];
  614. if (questions[i][j] == '\0') {
  615. break;
  616. }
  617. }
  618. //random array to mix letters
  619. int len = (int)strlen(arr);
  620. int charArr[len];
  621. int p = 0;
  622. for(int l = 0; l < 100; l++) {
  623. if (charNum[l] < len) {
  624. charArr[p] = charNum[l];
  625. p++;
  626. }
  627. }
  628. int randNum, f=0;
  629. for(int k = 0; k < strlen(arr); k++){
  630. randNum = charArr[k];
  631. print_questions[i][f] = arr[randNum];
  632. f++;
  633. }
  634. }
  635. //random geneator for questionmix
  636. int charArr2[6];
  637. int p1 = 0;
  638. for(int l = 0; l < 100; l++) {
  639. if (charNum[l] < 6) {
  640. charArr2[p1] = charNum[l];
  641. p1++;
  642. }
  643. }
  644. e_printout(print_questions,questions, charArr2);
  645. }
  646. void e_smart_brain() {
  647. e_display_instruction();
  648. e_ask_questions();
  649. if(score >=4 && track_r2_score ==2) {
  650. e_questions_r3();
  651. }
  652. guess_word_questions();
  653. e_anagram_questions();
  654. score = 0;
  655. track_r2_score = 0;
  656. }
  657. //-------smart_brain_quiz_end------------
  658. void million_instructions(){
  659. printf("Possible answers are A,B,C & D\n");
  660. printf("To use Fifty/Fifty Lifeline, Enter F\n");
  661. printf("To ask a Friend for help, Enter P\n");
  662. printf("To ask the Host for advice, Enter H\n");
  663. }
  664. void million_exit(int million_a){
  665. printf("\nYou have come to the end of Who Wants To Be A Millionaire\n");
  666. printf("\nYour Total Reward is %d\n",million_a);
  667. }
  668. void displayWelcomeMessage(void) {
  669. displayGameInstructions();
  670. }
  671. void displayGoodLuckMessage(void) {
  672. printf("\t\t------------------------------------------\n\n");
  673. printf("\t\t------------------------------------------\n\n");
  674. printf("\t\t GOOD LUCK! \n\n");
  675. printf("\t\t------------------------------------------\n");
  676. printf("\t\t------------------------------------------\n\n");
  677. }
  678. void displayGameInstructions(void) {
  679. printf("\t\t------------------------------------------\n");
  680. printf("\t\t Welcome to Quiz Game!\n\n");
  681. printf("\t\t------------------------------------------\n\n");
  682. printf("\t\t To start this game, here are the Instructions\n\n");
  683. printf("\t\t------------------------------------------\n");
  684. printf("\t\t------------------------------------------\n\n");
  685. printf("\t\t>>You will be presented with questions from\n");
  686. printf("\t\tRound 1 to Round 3(Easy rounds) and Round\n");
  687. printf("\t\t4 to Round 5(Hard rounds).<<\n");
  688. printf("\t\t>>For every question you have four options (A, B, C, D).<<\n");
  689. printf("\t\t>>For each question, you can either choose the\n");
  690. printf("\t\tanswer from the four options or use a lifeline.<<\n\n");
  691. printf("\t\t>>To Pass Through Round 1: You have to get 3 out of 5 correct.<<\n");
  692. printf("\t\t>>To Pass Through Round 2: You have to get 3 out of 5 correct.<<\n");
  693. printf("\t\t>>To Pass Through Round 3: You have to get 4 out of 5 correct.<<\n");
  694. printf("\t\t>>To Pass Through Round 4: You have to get 4 out of 5 correct.<<\n");
  695. printf("\t\t>>To Pass Through Round 5: You have to get 5 out of 5 correct.<<\n\n");
  696. printf("\t\t>>If you choose the wrong answer, you lose a point.<<\n\n");
  697. printf("\t\tYou may lose the game if not you don't have enough points to pass to the next round.\n\n");
  698. printf("\t\tIf you use a lifeline and still choose the wrong answer, you lose the game.\n");
  699. }
  700. void displayLifelineInstructions(void) {
  701. printf("\t\t>>You have the following lifelines available:<< \n");
  702. printf("\t\t>>'F' 50-50: Eliminates two incorrect answers.<< \n");
  703. printf("\t\t>>'H' Hint: Reveals a hint for the answer.<<\n");
  704. }
  705. void displayInstructions(void) {
  706. displayWelcomeMessage();
  707. displayLifelineInstructions();
  708. displayGoodLuckMessage();
  709. }
  710. void correct(int score2){
  711. printf("\nCorrect!\n");
  712. printf("You have %d points now\n\n", score);
  713. }
  714. void wrong(int score1){
  715. printf("\nWrong!\n");
  716. printf("You have %d points now\n\n", score);
  717. }
  718. void fifty_fifty(int question_num) {
  719. char qC[][100] = {
  720. "A.Mount Everest\nB.Uludag",
  721. "A.USA\nB.China",
  722. "C.Amazon River\nD.The Nile River",
  723. "A.San Fransisco\nB.San Diego",
  724. "C.Merida\nD.Mexico city",
  725. "C.Russia\nD.USA\n",
  726. "A.Alaska\nB.Washington",
  727. "C.Toronto\nD.Ottawa",
  728. "A.Egypt\nB.Mexico",
  729. "A.Surat Thani\nB.Bangkok",
  730. "B.Mexico\nC.USA",
  731. "C.Venice\nD.Naples",
  732. "B.Cluny\nC.The Louvre"
  733. };
  734. printf("%s\n",qC[question_num]);
  735. }
  736. void hintForHardQuestions(int question_num) {
  737. char hints[NUM_QUESTIONS][256] = {
  738. "The city is known for its iconic landmarks and romantic atmosphere.",
  739. "He was a general in the American Revolutionary War and is considered the Father of His Country.",
  740. "This team has won the most NBA championships in history, with a total of 16 championships.",
  741. "It is the lightest and most abundant chemical element in the universe.",
  742. "This South Korean film became the first non-English language film to win the Academy Award for Best Picture."
  743. };
  744. printf("Hint: %s\n", hints[question_num]);
  745. }
  746. void fifty_fifty1(int question_num) {
  747. char options[NUM_QUESTIONS][4][256] = {
  748. { "A) Berlin", "B) Paris", "C) London", "D) Rome" },
  749. { "A) George Washington", "B) John Adams", "C) Thomas Jefferson", "D) James Madison" },
  750. { "A) Los Angeles Lakers", "B) Chicago Bulls", "C) Golden State Warriors", "D) Boston Celtics" },
  751. { "A) He", "B) H", "C) O", "D) Ne" },
  752. { "A) Parasite", "B) Joker", "C) Once Upon a Time in Hollywood", "D) 1917" }
  753. };
  754. char correct_answer = answers[question_num];
  755. int num_incorrect = 0;
  756. int incorrect_indices[2];
  757. for (int i = 0; i < 4; i++) {
  758. if (options[question_num][i][0] != correct_answer) {
  759. incorrect_indices[num_incorrect] = i;
  760. num_incorrect++;
  761. }
  762. if (num_incorrect == 2) {
  763. break;
  764. }
  765. }
  766. for (int i = 0; i < 2; i++) {
  767. options[question_num][incorrect_indices[i]][0] = '\0';
  768. }
  769. // display remaining options
  770. for (int i = 0; i < 4; i++) {
  771. if (options[question_num][i][0] != '\0') {
  772. printf("%s\n", options[question_num][i]);
  773. }
  774. }
  775. }
  776. void printOutOption(char qS[][100], char qC[][100],char aS[], int initial, int end, int ranArr[]){
  777. char response;
  778. for (int i = initial; i < end; i++){
  779. int randNum = ranArr[i];
  780. printf("[%d] %s\n", i+1, qS[randNum]);
  781. printf("%s\n", qC[randNum]);
  782. printf("Enter your answer (A, B, C, or D) or use a lifeline (F for 50/50, H for hint): ");
  783. scanf(" %c", &response);
  784. response = toupper(response);
  785. if (response == 'F') {
  786. fifty_fifty(randNum);
  787. printf("Enter your answer (A, B, C, or D): ");
  788. scanf(" %c", &response);
  789. response = toupper(response);
  790. }
  791. else if (response == 'H') {
  792. hint(randNum);
  793. printf("Enter your answer (A, B, C, or D): ");
  794. scanf(" %c", &response);
  795. response = toupper(response);
  796. }
  797. if(response == aS[randNum]){
  798. score++;
  799. correct(score);
  800. } else {
  801. wrong(score);
  802. }
  803. }
  804. }
  805. void looping(char qS[][100], char qC[][100], char aS[], int randArr[]){
  806. int k = 0;
  807. while(k < 1){
  808. printf("\t\t--------------------Round 1-------------------\n\n");
  809. printf(">>In this round you need to answer 3 questions correctly to move to Round 2<<\n\n");
  810. int initial = 0, end = 2;
  811. printOutOption(qS,qC,aS,initial,end,randArr);
  812. if (score < 1) {
  813. printf("You lost! Better luck next time\n");
  814. break;
  815. } else {
  816. printf("\t\t--------------------Round 2-------------------\n\n");
  817. printf(">>In this round you need to answer 2 questions correctly to move to Round 3<<\n\n");
  818. initial = 2, end = 4;
  819. printOutOption(qS,qC,aS,initial,end,randArr);
  820. }
  821. if (score < 1) {
  822. printf("You lost! Better luck next time\n");
  823. break;
  824. } else {
  825. printf("\t\t--------------------Round 3-------------------\n\n");
  826. printf(">>In this round you need to answer 2 questions correctly to move to Round 4<<\n\n");
  827. initial = 4, end = 7;
  828. printOutOption(qS,qC,aS,initial,end,randArr);
  829. }
  830. k++;
  831. }
  832. if (score < 2) {
  833. printf("\nYour final score: %d\n", score);
  834. }
  835. }
  836. void ask_questions(void) {
  837. char questions[][100] = {
  838. "What is the name of the tallest mountain in the world?\n",
  839. "Which country has the largest population in the world??\n",
  840. "What is the name of the longest river in Africa?\n",
  841. "What American city is the Golden Gate Bridge located in?\n",
  842. "What is the capital of Mexico?\n",
  843. "What is the name of the largest country in the world?\n",
  844. "What U.S. state is home to no documented poisonous snakes?\n",
  845. "What is the capital of Canada?\n",
  846. "What country are the Great Pyramids of Giza located in?\n",
  847. "What is the capital of Thailand?\n",
  848. "In which country was Frida Kahlo born?\n",
  849. "What present-day Italian city does Mt. Vesuvius overlook?\n",
  850. "The Mona Lisa by Leonardo da Vinci is on display in which Paris museum?\n"
  851. };
  852. char possible_options[][100] = {
  853. "A.Mount Everest\nB.Uludag\nC.K2\nD.Makalu",
  854. "A.USA\nB.China\nC.Russia\nD.India",
  855. "A.Missisipi River\nB.Yangtze River\nC.Amazon River\nD.The Nile River",
  856. "A.San Fransisco\nB.San Diego\nC.New York\nD.Los Angeles",
  857. "A.Oaxaca\nB.Puebla\nC.Merida\nD.Mexico city",
  858. "A.India\nB.China\nC.Russia\nD.USA",
  859. "A.Alaska\nB.Washington\nC.Ohio\nD.California",
  860. "A.Vancouver\nB.Montreal\nC.Toronto\nD.Ottawa",
  861. "A.Egypt\nB.Mexico\nC.Iceland\nD.Greenland",
  862. "A.Surat Thani\nB.Bangkok\nC.Phuket\nD.Pattaya City",
  863. "A.Austria\nB.Mexico\nC.USA\nD.India",
  864. "A.Milan\nB.Rome\nC.Venice\nD.Naples",
  865. "A.Carnavalet\nB.Cluny\nC.The Louvre\nD.Musee d'Orsay"
  866. };
  867. char answers[100] = {
  868. 'A',
  869. 'B',
  870. 'D',
  871. 'A',
  872. 'D',
  873. 'C',
  874. 'A',
  875. 'D',
  876. 'A',
  877. 'B',
  878. 'B',
  879. 'D',
  880. 'C'
  881. };
  882. int* randArr = randomNumber();
  883. int arr[11];
  884. int p = 0;
  885. for(int i = 0; i < 100; i++){
  886. if(randArr[i] < 11){
  887. arr[p] = randArr[i];
  888. p++;
  889. }
  890. }
  891. looping(questions, possible_options, answers, arr);
  892. }
  893. void ask_hard_questions(void) {
  894. int k = 0;
  895. while (k < 1) {
  896. int *lessFive = randomNumber();
  897. int arr[5];
  898. int p = 0;
  899. for(int i = 0; i < 100; i++){
  900. if(lessFive[i] < 5){
  901. arr[p] = lessFive[i];
  902. p++;
  903. }
  904. }
  905. printf("\t\t--------------------Round 4-------------------\n\n");
  906. printf(">>In this round you need to answer 2 questions correctly to move to Round 5<<\n\n");
  907. char questions[NUM_QUESTIONS][256] = {
  908. "What is the capital of France?",
  909. "Who was the first president of the United States?",
  910. "Which team won the most NBA championships?",
  911. "What is the chemical symbol for hydrogen?",
  912. "Which of the following movies won the Academy Award for Best Picture in 2020?"
  913. };
  914. char options[NUM_QUESTIONS][4][256] = {
  915. { "A) Berlin", "B) Paris", "C) London", "D) Rome" },
  916. { "A) George Washington", "B) John Adams", "C) Thomas Jefferson", "D) James Madison" },
  917. { "A) Los Angeles Lakers", "B) Chicago Bulls", "C) Golden State Warriors", "D) Boston Celtics" },
  918. { "A) He", "B) H", "C) O", "D) Ne"},
  919. { "A) Parasite", "B) Joker", "C) Once Upon a Time in Hollywood", "D) 1917" }
  920. };
  921. char user_answers[NUM_QUESTIONS];
  922. int lifelines[NUM_QUESTIONS] = { 1, 1,1,1,1};
  923. int randNum;
  924. for (int i = 0; i < 3; i++) {
  925. randNum = arr[i];
  926. printf("[%d] %s\n", i + 1, questions[randNum]);
  927. for (int j = 0; j < 4; j++) {
  928. printf("%s\n", options[randNum][j]);
  929. }
  930. printf("Enter your answer (A, B, C, or D) or use a lifeline (F for 50/50, H for hint): ");
  931. char response;
  932. scanf(" %c", &response);
  933. response = toupper(response);
  934. if (response == 'F' && lifelines[i] == 1) {
  935. fifty_fifty1(randNum);
  936. printf("Enter your answer (A, B, C, or D): ");
  937. scanf(" %c", &user_answers[randNum]);
  938. user_answers[randNum] = toupper(user_answers[randNum]);
  939. lifelines[i] = 0;
  940. }else if (response == 'H' && lifelines[i] == 1) {
  941. hintForHardQuestions(randNum);
  942. printf("Enter your answer (A, B, C, or D): ");
  943. scanf(" %c", &user_answers[randNum]);
  944. user_answers[randNum] = toupper(user_answers[randNum]);
  945. lifelines[i] = 0;
  946. }else {
  947. user_answers[randNum] = response;
  948. }
  949. if (user_answers[randNum] == answers[randNum]) {
  950. score++;
  951. correct(score);
  952. } else {
  953. wrong(score);
  954. }
  955. }
  956. if ( score < 4) {
  957. printf("You lost! Better luck next time\n");
  958. break;
  959. } else {
  960. printf("\t\t--------------------Round 5-------------------\n\n");
  961. printf(">>This is the final round. Good Luck!<<\n\n");
  962. for (int i = 3; i < 5; i++) {
  963. randNum = arr[i];
  964. printf("[%d] %s\n", i + 1, questions[randNum]);
  965. for (int j = 0; j < 4; j++) {
  966. printf("%s\n", options[randNum][j]);
  967. }
  968. printf("Enter your answer (A, B, C, or D) or use a lifeline (F for 50/50, H for hint): ");
  969. char response;
  970. scanf(" %c", &response);
  971. response = toupper(response);
  972. if (response == 'F' && lifelines[i] == 1) {
  973. fifty_fifty1(randNum);
  974. printf("Enter your answer (A, B, C, or D): ");
  975. scanf(" %c", &user_answers[randNum]);
  976. user_answers[randNum] = toupper(user_answers[randNum]);
  977. lifelines[i] = 0;
  978. }else if (response == 'H' && lifelines[i] == 1) {
  979. hintForHardQuestions(randNum);
  980. printf("Enter your answer (A, B, C, or D): ");
  981. scanf(" %c", &user_answers[randNum]);
  982. user_answers[randNum] = toupper(user_answers[randNum]);
  983. lifelines[i] = 0;
  984. }else {
  985. user_answers[randNum] = response;
  986. }
  987. // check each answer
  988. if (user_answers[randNum] == answers[randNum]) {
  989. score++;
  990. correct(score);
  991. } else {
  992. wrong(score);
  993. }
  994. }
  995. }
  996. k++;
  997. }
  998. printf("\nYour final score: %d\n", score);
  999. }
  1000. void hint(int question_num) {
  1001. char qC[][100] = {
  1002. "Hint:The Tallest mountain is 8,849m.",
  1003. "Hint:It's population is 1.412 billion.",
  1004. "Hint:The longest river measures 6,650km.",
  1005. "Hint:The Golden States Warriors play there.\n",
  1006. "Hint:It is one of the oldest and largest cities in the Americas.\n",
  1007. "Hint:The area of the largest country is 17.1 million km2.\n",
  1008. "Hint:It is the coldest state in the US.",
  1009. "Hint:It is the 4th largest city in Canada.",
  1010. "Hint:It is a dry Country.",
  1011. "Hint:The capital has the longest city name in the world.",
  1012. "Hint:The Native language is Spanish.",
  1013. "Hint:The city that invented Swamp Buggy Racing.",
  1014. "Hint:It is the most visited art museum in the world."
  1015. };
  1016. printf("%s\n",qC[question_num]);
  1017. }
  1018. void displayThankYouMessage(void) {
  1019. printf("*******************************\n");
  1020. printf("Thank you for playing QuizGame!\n");
  1021. printf("*******************************\n\n");
  1022. }
  1023. void play_quizgame(void){
  1024. displayInstructions();
  1025. printf(">>Press 's' and Enter to start the Game<<\n");
  1026. char var, var1 = 's';
  1027. getchar();
  1028. while(var != var1) {
  1029. var = getchar();
  1030. }
  1031. printf("\n");
  1032. ask_questions();
  1033. if (score > 2){
  1034. ask_hard_questions();
  1035. }
  1036. displayThankYouMessage();
  1037. }
  1038. void v_factorlie(void){
  1039. char statements[][100] = {
  1040. "Tomatoes are fruits.", // fact
  1041. "The Great Wall of China is visible from space.", // lie
  1042. "Water freezes at 0 degrees Celsius.", // fact
  1043. "Napoleon Bonaparte ruled Germany at a time in history.", // fact
  1044. "Barack Obama was born in America." // lie
  1045. };
  1046. char answers[] = {'F','L','F','F','L'}; // L for lie, F for fact
  1047. int num_statements = sizeof(statements) / sizeof(statements[0]);
  1048. int score = 0;
  1049. printf("\nWelcome to the Fact or Lie Quiz!\n\n");
  1050. for (int i = 0; i < num_statements; i++) {
  1051. char user_answer;
  1052. printf("Statement %d: %s\n\n", i + 1, statements[i]);
  1053. printf("Is this statement a fact (F) or a lie (L)?\n");
  1054. printf("Your answer: \n");
  1055. scanf(" %c", &user_answer);
  1056. user_answer = toupper(user_answer);
  1057. if (user_answer == answers[i]) {
  1058. score++;
  1059. printf("Correct! You get a point.\n\n");
  1060. } else {
  1061. printf("Sorry, its incorrect. No points!\n\n");
  1062. }
  1063. }
  1064. printf("Your final score is %d out of %d.\n", score, num_statements);
  1065. }
  1066. void play_factorlie() {
  1067. printf("**********************\n");
  1068. printf("Playing Fact or Lie!\n");
  1069. printf("**********************\n");
  1070. v_factorlie();
  1071. printf("**********************************\n");
  1072. printf("Thank you for playing Fact or Lie!\n");
  1073. printf("**********************************\n");
  1074. }
  1075. void play_milliongame() {
  1076. printf("\nPlaying who wants to be a millionaire...\n\n");
  1077. int million_i = 0, million_k = 0;;
  1078. char million_user_answers[NUM_ROUNDS];
  1079. char million_std_answers[NUM_ROUNDS] = {'B', 'C', 'D', 'C', 'B', 'D', 'B', 'A', 'B', 'B', 'A', 'D', 'C', 'C', 'B'};
  1080. int million_stay_in_game = 0, million_reward = 0, million_checkpoint = 0, million_count_replace = 0;
  1081. int million_lifeline_hint = 1, million_lifeline_delete = 1, million_lifeline_friend = 1;
  1082. char questions[NUM_ROUNDS][256] = {
  1083. "What is the capital of France?",
  1084. "Which Disney character famously leaves a glass slipper behind at a royal ball?",
  1085. "What name is given to the revolving belt machinery in an airport that delivers checked luggage from the plane to baggage reclaim?",
  1086. "Which of these brands was chiefly associated with the manufacture of household locks?",
  1087. "The hammer and sickle is one of the most recognisable symbols of which political ideology?",
  1088. "Which toys have been marketed with the phrase “robots in disguise”?",
  1089. "What does the word loquacious mean?",
  1090. "Obstetrics is a branch of medicine particularly concerned with what?",
  1091. "In Doctor Who, what was the signature look of the fourth Doctor, as portrayed by Tom Baker?",
  1092. "Which of these religious observances lasts for the shortest period of time during the calendar year?",
  1093. "At the closest point, which island group is only 50 miles south-east of the coast of Florida?",
  1094. "Construction of which of these famous landmarks was completed first?",
  1095. "Which of these cetaceans is classified as a “toothed whale”?",
  1096. "Who is the only British politician to have held all four “Great Offices of State” at some point during their career?",
  1097. "In 1718, which pirate died in battle off the coast of what is now North Carolina?"
  1098. };
  1099. char answers[NUM_ROUNDS][4][256] = {
  1100. { "A) Berlin", "B) Paris", "C) London", "D) Rome" },
  1101. { "A) Pocahontas", "B) Sleeping Beauty", "C) Cinderella", "D) Elsa" },
  1102. { "A) Hangar", "B) Terminal", "C) Concourse", "D) Carousel" },
  1103. { "A) Phillips", "B) Flymo", "C) Chubb", "D) Ronseal" },
  1104. { "A) Republicanism", "B) Communism", "C) Conservatism", "D) Liberalism" },
  1105. { "A) Bratz Dolls", "B) Sylvanian Families", "C) Hatchimals", "D) Transformers" },
  1106. { "A) Angry", "B) Chatty", "C) Beautiful", "D) Shy" },
  1107. { "A) Childbirth", "B) Broken bones", "C) Heart conditions", "D) Old age" },
  1108. { "A) Bow-tie, braces and tweed jacket", "B) Wide-brimmed hat and extra long scarf", "C) Pinstripe suit and trainers", "D) Cape, velvet jacket and frilly shirt" },
  1109. { "A) Ramadan", "B) Diwali", "C) Lent", "D) Hanukkah" },
  1110. { "A) Bahamas", "B) US Virgin Islands", "C) Turks and Caicos Islands", "D) Bermuda" },
  1111. { "A) Empire State Building", "B) Royal Albert Hall", "C) Eiffel Tower", "D) Big Ben Clock Tower" },
  1112. { "A) Gray whale", "B) Minke whale", "C) Sperm whale", "D) Humpback whale" },
  1113. { "A) David Lloyd George", "B) Harold Wilson", "C) James Callaghan", "D) John Major" },
  1114. { "A) Calico Jack", "B) Blackbeard", "C) Bartholomew Roberts", "D) Captain Kidd" }
  1115. };
  1116. million_instructions();
  1117. while(million_i < NUM_ROUNDS && million_stay_in_game == 0){
  1118. printf("\nYou have %d:Fifty/Fifty\t%d:Phone a Friend\t%d:Hint\t\n",million_lifeline_delete,million_lifeline_friend,million_lifeline_hint);
  1119. printf("\n%s\n",questions[million_i]);
  1120. for(int j=0;j<4;j++){
  1121. printf("%s\n",answers[million_i][j]);
  1122. }
  1123. point_one:
  1124. printf("Enter a valid Response: ");
  1125. scanf(" %c", &million_user_answers[million_i]);
  1126. million_user_answers[million_i] = toupper(million_user_answers[million_i]);
  1127. switch(million_user_answers[million_i]){
  1128. case 'A':
  1129. if(million_user_answers[million_i] == million_std_answers[million_i]){
  1130. printf("\nCorrect!");
  1131. million_reward = million_reward + (10000 * (million_i+1));
  1132. printf("\n%d\n",million_reward);
  1133. if(million_i == 0){
  1134. million_checkpoint = 0;
  1135. }
  1136. else if(million_i == 4){
  1137. million_checkpoint = million_reward;
  1138. }
  1139. else if(million_i == 9)
  1140. million_checkpoint = million_reward;
  1141. else{}
  1142. }
  1143. else{
  1144. printf("\nIncorrect!");
  1145. million_stay_in_game == 1;
  1146. }
  1147. break;
  1148. case 'B':
  1149. if(million_user_answers[million_i] == million_std_answers[million_i]){
  1150. million_reward = million_reward + (10000 * (million_i+1));
  1151. printf("\n%d\n",million_reward);
  1152. printf("\nCorrect!");
  1153. if(million_i == 0){
  1154. million_checkpoint = 0;
  1155. }
  1156. else if(million_i == 4){
  1157. million_checkpoint = million_reward;
  1158. }
  1159. else if(million_i == 9)
  1160. million_checkpoint = million_reward;
  1161. else{}
  1162. }
  1163. else{
  1164. printf("\nIncorrect!");
  1165. million_stay_in_game == 1;
  1166. }
  1167. break;
  1168. case 'C':
  1169. if(million_user_answers[million_i] == million_std_answers[million_i]){
  1170. million_reward = million_reward + (10000 * (million_i+1));
  1171. printf("\n%d\n",million_reward);
  1172. printf("\nCorrect!");
  1173. if(million_i == 0){
  1174. million_checkpoint = 0;
  1175. }
  1176. else if(million_i == 4){
  1177. million_checkpoint = million_reward;
  1178. }
  1179. else if(million_i == 9)
  1180. million_checkpoint = million_reward;
  1181. else{}
  1182. }
  1183. else{
  1184. printf("\nIncorrect!");
  1185. million_stay_in_game == 1;
  1186. }
  1187. break;
  1188. case 'D':
  1189. if(million_user_answers[million_i] == million_std_answers[million_i]){
  1190. million_reward = million_reward + (10000 * (million_i+1));
  1191. printf("\n%d\n",million_reward);
  1192. printf("\nCorrect!");
  1193. if(million_i == 0){
  1194. million_checkpoint = 0;
  1195. }
  1196. else if(million_i == 4){
  1197. million_checkpoint = million_reward;
  1198. }
  1199. else if(million_i == 9)
  1200. million_checkpoint = million_reward;
  1201. else{}
  1202. }
  1203. else{
  1204. printf("\nIncorrect!");
  1205. million_stay_in_game == 1;
  1206. }
  1207. break;
  1208. case 'H':
  1209. if(million_lifeline_hint != 1){
  1210. printf("\nHint already used\n");
  1211. goto point_one;
  1212. } else {
  1213. million_lifeline_hint = 0;
  1214. printf("Hint would be displayed here\n");
  1215. goto point_one;
  1216. }
  1217. break;
  1218. case 'F':
  1219. if(million_lifeline_delete != 1){
  1220. printf("\nFifty/Fifty lifeline already used\n");
  1221. goto point_one;
  1222. }
  1223. else {
  1224. million_lifeline_delete = 0;
  1225. printf("\nComputer will now MARK two wrong answers...\n");
  1226. while(million_k < 4 && million_count_replace < 2){
  1227. if(answers[million_i][million_k][0] != million_std_answers[million_i]){
  1228. answers[million_i][million_k][0] = 'X';
  1229. million_count_replace = million_count_replace + 1;
  1230. }
  1231. million_k++;
  1232. }
  1233. for(int million_n = 0; million_n < 4; million_n++){
  1234. printf("%s\n",answers[million_i][million_n]);
  1235. }
  1236. goto point_one;
  1237. }
  1238. break;
  1239. case 'P':
  1240. if(million_lifeline_friend != 1){
  1241. printf("\nLifeline Friend already used\n");
  1242. goto point_one;
  1243. }
  1244. else{
  1245. million_lifeline_friend = 0;
  1246. printf("\nYou can now ask a friend for help...\n");
  1247. for(int j=0;j<4;j++){
  1248. printf("%s\n",answers[million_i][j]);
  1249. }
  1250. goto point_one;
  1251. }
  1252. break;
  1253. case 'T':
  1254. million_stay_in_game = 1;
  1255. break;
  1256. default:
  1257. goto point_one;
  1258. }
  1259. million_i++;
  1260. }
  1261. million_exit(million_checkpoint);
  1262. // code for game 3 goes here
  1263. }
  1264. void v_guessingGame(void){
  1265. int secret_number, guess;
  1266. srand(time(NULL));
  1267. secret_number = rand() % 100 + 1;
  1268. printf("Guess the Number!\n\n");
  1269. printf("I am thinking of a number between 1 and 100. Can you guess what it is?\n");
  1270. while (1) {
  1271. printf("Enter your guess: ");
  1272. scanf("%d", &guess);
  1273. if (guess > secret_number) {
  1274. printf("Too high! Try again.\n");
  1275. } else if (guess < secret_number) {
  1276. printf("Too low! Try again.\n");
  1277. } else {
  1278. printf("Congratulations, you found the secret number!\n");
  1279. break;
  1280. }
  1281. }
  1282. }
  1283. void play_guessingGame() {
  1284. printf("*************************\n");
  1285. printf("Playing Guess the Number!\n");
  1286. printf("*************************\n\n");
  1287. v_guessingGame();
  1288. printf("****************************************\n");
  1289. printf("Thank you for playing Guess the Number!\n");
  1290. printf("****************************************\n");
  1291. }
  1292. void v_guessTheWord(char word[], char guessed[]) {
  1293. int i;
  1294. for (i = 0; i < strlen(word); i++) {
  1295. if (guessed[i]) {
  1296. printf("%c ", word[i]);
  1297. } else {
  1298. printf("_ ");
  1299. }
  1300. }
  1301. printf("\n");
  1302. }
  1303. void play_guessTheWord() {
  1304. char word[] = "Fulda";
  1305. char guessed[MAX_WORD_LENGTH] = {0};
  1306. int lives = MAX_LIVES;
  1307. int word_length = strlen(word);
  1308. char guess;
  1309. guess = toupper(guess);
  1310. printf("***********************\n");
  1311. printf("Playing Guess the Word!\n");
  1312. printf("***********************\n\n");
  1313. printf("IMPORTANT: The first letter is a capital letter!\n\n");
  1314. while (lives > 0) {
  1315. int i;
  1316. int correct = 0;
  1317. printf("Lives: %d\n", lives);
  1318. v_guessTheWord(word, guessed);
  1319. printf("Guess a letter: ");
  1320. scanf(" %c", &guess);
  1321. for (i = 0; i < word_length; i++) {
  1322. if (word[i] == guess) {
  1323. guessed[i] = guess;
  1324. correct = 1;
  1325. }
  1326. }
  1327. if (!correct) {
  1328. lives--;
  1329. }
  1330. if (strcmp(word, guessed) == 0) {
  1331. printf("You win! The word was: %s\n\n", word);
  1332. printf("*************************************\n");
  1333. printf("Thank you for playing Guess the Word!\n");
  1334. printf("*************************************\n");
  1335. break;
  1336. }
  1337. }
  1338. if (lives == 0) {
  1339. printf("You lose! The word was: %s\n\n", word);
  1340. printf("*************************************\n");
  1341. printf("Thank you for playing Guess the Word!\n");
  1342. printf("*************************************\n");
  1343. }
  1344. }
  1345. void B_show_time(void) {
  1346. time_t current_time;
  1347. struct tm *time_info;
  1348. char time_string[9];
  1349. time(&current_time);
  1350. time_info = localtime(&current_time);
  1351. strftime(time_string, sizeof(time_string), "%H:%M", time_info);
  1352. printf("The current time is: %s\n\n", time_string);
  1353. }
  1354. void B_displayWelcomeMessage(void) {
  1355. printf("\t\t------------------------------------------\n\n");
  1356. printf("\t\t------------------------------------------\n\n");
  1357. printf("\t\t Welcome to The EPIC GAME \n\n");
  1358. printf("\t\t------------------------------------------\n");
  1359. printf("\t\t------------------------------------------\n\n");
  1360. }
  1361. void B_sayhello(char name[]){
  1362. printf(". Hello %s \n\n", name);
  1363. }
  1364. void B_username(void) {
  1365. char name[100] = {0};
  1366. printf("Please create a fun Username\n\n");
  1367. scanf("%s", name);
  1368. B_sayhello(name);
  1369. }
  1370. void b_entertostart() {
  1371. char enter;
  1372. printf("\t\t Press 'any key' to begin \n");
  1373. scanf(" %c", &enter);
  1374. enter = toupper(enter);
  1375. }
  1376. void B_userinfo(void){
  1377. char info[100] = {0};
  1378. printf("How old are you?\n");
  1379. scanf("%s", info);
  1380. printf("\t\t You are old enough!!!\n\n");
  1381. }
  1382. void B_displayGameInstructions() {
  1383. printf("To start this game, here are the instructions:\n\n # Read each question carefully and select the best answer from the choices provided.\n # You will receive points and prizes for each correct answer, and the game will keep track of your progress.\n # At the end of the game, you will be shown your final score and will have the option to play again.\n # Have fun and good luck!\n\n\n");
  1384. }
  1385. int B_testround(void) {
  1386. int score = 0;
  1387. char answer[20];
  1388. printf("Play a Test Round!\n\n");
  1389. printf("The points you get in this round will be added to the other rounds.\n\n");
  1390. printf("Question 1: What is the capital of Spain?\n\n");
  1391. printf("Hint: It is located in the center of the country.\n\n");
  1392. printf("Options: a.)Madrid b.)Barcelona c.)Valencia d.)Granada\n\n ");
  1393. printf("Answer: ");
  1394. scanf("%s", answer);
  1395. if (strcmp(answer, "a") == 0) {
  1396. printf("Correct!\n\n");
  1397. score++;
  1398. } else {
  1399. printf("Incorrect. The answer is a.\n\n");
  1400. }
  1401. printf("Question 2: What is the smallest planet in our solar system?\n\n");
  1402. printf("Hint: It is named after the messenger of the gods.\n\n");
  1403. printf("Options: a.)Earth b.)Mars c.)Mercury d.)Sun\n\n");
  1404. printf("Answer: ");
  1405. scanf("%s", answer);
  1406. if (strcmp(answer, "c") == 0) {
  1407. printf("Correct!\n\n");
  1408. score++;
  1409. } else {
  1410. printf("Incorrect. The answer is c.\n\n");
  1411. }
  1412. return score;
  1413. }
  1414. int B_round1(void) {
  1415. int score = 0;
  1416. char answer[20];
  1417. printf("Round 1 - Math\n\n");
  1418. printf("Question 1: What is the value of x in the equation 2x + 1 = 7?\n\n");
  1419. printf("Hint: Subtract 1 from both sides and then divide both sides by 2.\n\n");
  1420. printf("Options: 6, 1, 3, 4\n\n");
  1421. printf("Answer: ");
  1422. scanf("%s", answer);
  1423. if (strcmp(answer, "3") == 0) {
  1424. printf("Correct! You won a diamond.\n\n");
  1425. int i, j, k;
  1426. for (i = 0; i < 5; i++)
  1427. {
  1428. for (j = 5 - i; j > 1; j--)
  1429. {
  1430. printf(" ");
  1431. }
  1432. for (k = 0; k <= (2 * i); k++)
  1433. {
  1434. printf("*");
  1435. }
  1436. printf("\n");
  1437. }
  1438. for (i = 4; i >= 0; i--)
  1439. {
  1440. for (j = 5 - i; j > 1; j--)
  1441. {
  1442. printf(" ");
  1443. }
  1444. for (k = 0; k <= (2 * i); k++)
  1445. {
  1446. printf("*");
  1447. }
  1448. printf("\n");
  1449. }
  1450. score++;
  1451. } else {
  1452. printf("Incorrect. The answer is 3.\n\n");
  1453. }
  1454. printf("Question 2: What is the value of x in the equation 3x + 2 = 8?\n\n");
  1455. printf("Hint: Subtract 2 from both sides and then divide both sides by 3.\n\n");
  1456. printf("Options: 1, 2, 3, 4\n\n");
  1457. printf("Answer: ");
  1458. scanf("%s", answer);
  1459. if (strcmp(answer, "2") == 0) {
  1460. printf("Correct! You won a triangle.\n\n");
  1461. int i, j;
  1462. for (i = 0; i < 5; i++) {
  1463. for (j = 0; j <= i; j++) {
  1464. printf("*");
  1465. }
  1466. printf("\n");
  1467. }
  1468. score++;
  1469. } else {
  1470. printf("Incorrect. The answer is 2.\n\n");
  1471. }
  1472. return score;
  1473. }
  1474. int B_round2(void) {
  1475. int score = 0;
  1476. char answer[20];
  1477. printf("Round 2 - True or False\n\n");
  1478. printf("Question 1: The sun rises in the west.\n\n");
  1479. printf("Hint:Think about the Earth's rotation on its axis towards the east.\n\n");
  1480. printf("Options: Ture, False\n\n");
  1481. printf("Answer: ");
  1482. scanf("%s", answer);
  1483. if (strcmp(answer, "False") == 0) {
  1484. printf("Correct! You won a star.\n\n");
  1485. int i, j, k;
  1486. for (i = -4; i <= 4; i++) {
  1487. for (j = 4; j >= abs(i); j--) {
  1488. printf(" ");
  1489. }
  1490. for (k = 1; k <= abs(2 * i + 1); k++) {
  1491. if (abs(i) == 4 || k == 1 || k == abs(2 * i + 1)) {
  1492. printf("*");
  1493. } else {
  1494. printf(" ");
  1495. }
  1496. }
  1497. printf("\n");
  1498. }
  1499. score++;
  1500. } else {
  1501. printf("Incorrect. The answer is False.\n\n");
  1502. }
  1503. printf("Question 2: The capital city of France is known as the 'City of Love'.\n\n");
  1504. printf("Hint: It is one of the most popular cities in the world.\n\n");
  1505. printf("Options: True, False\n\n");
  1506. printf("Answer: ");
  1507. scanf("%s", answer);
  1508. if (strcmp(answer, "True") == 0) {
  1509. printf("Correct! You won a Sword.\n\n");
  1510. printf(" /\\\n");
  1511. printf(" / \\\n");
  1512. printf(" / \\\n");
  1513. printf(" / \\\n");
  1514. printf(" /________\\\n");
  1515. printf(" | \n");
  1516. printf(" | \n");
  1517. printf(" | \n");
  1518. printf(" | \n");
  1519. printf(" | \n");
  1520. score++;
  1521. } else {
  1522. printf("Incorrect. The answer is True.\n\n");
  1523. }
  1524. return score;
  1525. }
  1526. int B_round3(void) {
  1527. int score = 0;
  1528. char answer[20];
  1529. printf("Round 3\n\n");
  1530. printf("Question 1: How many planets are in our solar system?\n\n");
  1531. printf("Hint: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune.\n\n");
  1532. printf("Options: 5, 6, 7, 8\n\n");
  1533. printf("Answer: ");
  1534. scanf("%s", answer);
  1535. if (strcmp(answer, "8") == 0) {
  1536. printf("Correct! You won a triangle.\n\n");
  1537. int i, j;
  1538. for (i = 0; i < 5; i++) {
  1539. for (j = 0; j <= i; j++) {
  1540. printf("*");
  1541. }
  1542. printf("\n");
  1543. }
  1544. score++;
  1545. } else {
  1546. printf("Incorrect. The answer is 8.\n\n");
  1547. }
  1548. printf("Question 2: How many bones are there in the human body?\n\n");
  1549. printf("Hint: This number may vary in childhood due to some bones merging together as the body grows and develops.\n\n");
  1550. printf("Options: 206, 205, 207, 204\n\n");
  1551. printf("Answer: ");
  1552. scanf("%s", answer);
  1553. if (strcmp(answer, "206") == 0) {
  1554. printf("Correct! You won a cat.\n\n");
  1555. printf(" /\\_/\\\n( o.o )\n > ^ < \n");
  1556. score++;
  1557. } else {
  1558. printf("Incorrect. The answer is 206.\n\n");
  1559. }
  1560. return score;
  1561. }
  1562. int B_round4(void) {
  1563. int score = 0;
  1564. char answer[20];
  1565. printf("Round 4\n\n");
  1566. printf("Question 1: What is the capital of France?\n\n");
  1567. printf("Hint: It is known as the City of Light.\n\n");
  1568. printf("Options: Paris, London, Madrid, Berlin\n\n");
  1569. printf("Answer: ");
  1570. scanf("%s", answer);
  1571. if (strcmp(answer, "Paris") == 0) {
  1572. printf("Correct! You won a Cow.\n\n");
  1573. printf(" \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n ||----w |\n || ||\n");
  1574. score++;
  1575. } else {
  1576. printf("Incorrect. The answer is Paris.\n\n");
  1577. }
  1578. printf("Question 2: Who painted the Mona Lisa?\n\n");
  1579. printf("Hint: He was a famous Italian artist.\n\n");
  1580. printf("Options: a.)Leonardo da Vinci b.)Michelangelo c.)Raphael d.)Titian\n\n");
  1581. printf("Answer: ");
  1582. scanf("%s", answer);
  1583. if (strcmp(answer, "a") == 0) {
  1584. printf("Correct! You won a stick man.\n\n");
  1585. printf(" o\n \\|/\n / \\\n");
  1586. score++;
  1587. } else {
  1588. printf("Incorrect. The answer is a.\n\n");
  1589. }
  1590. return score;
  1591. }
  1592. int B_round5(void) {
  1593. int score = 0;
  1594. char answer[20];
  1595. printf("Round 5\n\n");
  1596. printf("Question 1: Who invented the World Wide Web?\n\n");
  1597. printf("Hint: He is a British computer scientist.\n\n");
  1598. printf("Options: a.)Bill Gates, b.)Steve Jobs, c.)Tim Berners-Lee, d.)Mark Zuckerberg\n\n");
  1599. printf("Answer: ");
  1600. scanf("%s", answer);
  1601. if (strcmp(answer, "c") == 0) {
  1602. printf("Correct! You won a diamond.\n\n");
  1603. printf(" /\\\n ( )\n ( )\n ( )\n \\/\n");
  1604. score++;
  1605. } else {
  1606. printf("Incorrect. The answer is c.\n\n");
  1607. }
  1608. printf("Question 2: Who was the first person to walk on the Moon?\n\n");
  1609. printf("Hint: He was an American astronaut.\n\n");
  1610. printf("Options: a.)Neil Armstrong b.)Buzz Aldrin c.)Michael Collins d.)Pete Conrad\n\n");
  1611. printf("Answer: ");
  1612. scanf("%s", answer);
  1613. if (strcmp(answer, "a") == 0) {
  1614. printf("Correct! You won a sitting stick man.\n\n");
  1615. printf(" (o)\n /( )\\\n( )( )\n");
  1616. score++;
  1617. } else {
  1618. printf("Incorrect. The answer is a.\n\n");
  1619. }
  1620. return score;
  1621. }
  1622. int B_round6(void) {
  1623. int score = 0;
  1624. char answer[20];
  1625. printf("Round 6\n\n");
  1626. printf("Question 1: Who wrote the novel 'To Kill a Mockingbird'?\n\n");
  1627. printf("Hint: She is known as an American novelist.\n\n");
  1628. printf("Options: a.)Jane Austen, b.)Agatha Christie, c.)Harper Lee, d.)Mary Shelley\n\n");
  1629. printf("Answer: ");
  1630. scanf("%s", answer);
  1631. if (strcmp(answer, "c") == 0) {
  1632. printf("Correct! You won a turtle shell.\n\n");
  1633. printf(" ___\n // \\\\\n(( ))\n \\ //\n ----\n");
  1634. score++;
  1635. } else {
  1636. printf("Incorrect. The answer is c.\n\n");
  1637. }
  1638. printf("Question 2: Who painted the famous artwork 'The Starry Night'?\n\n");
  1639. printf("Hint: He was a post-Impressionist painter.\n\n");
  1640. printf("Options: a.)Vincent van Gogh b.)Pablo Picasso c.)Leonardo da Vinci d.)Rembrandt\n\n");
  1641. printf("Answer: ");
  1642. scanf("%s", answer);
  1643. if (strcmp(answer, "a") == 0) {
  1644. printf("Correct! you won a dog.\n\n");
  1645. printf(" /\\_/\\\n( o.o )\n > ^ < \n");
  1646. score++;
  1647. } else {
  1648. printf("Incorrect. The answer is a.\n\n");
  1649. }
  1650. return score;
  1651. }
  1652. int B_round7(void) {
  1653. int score = 0;
  1654. char answer[20];
  1655. printf("Round 7\n\n");
  1656. printf("Question 1: Who directed the movie 'The Shawshank Redemption'?\n\n");
  1657. printf("Hint: He is known for his work in Hollywood.\n\n");
  1658. printf("Options: a.)Martin Scorsese b.)Francis Ford Coppola c.)Steven Spielberg d.)Frank Darabont\n\n");
  1659. printf("Answer: ");
  1660. scanf("%s", answer);
  1661. if (strcmp(answer, "d") == 0) {
  1662. printf("Correct! You won a house.\n\n");
  1663. printf(" _____\n");
  1664. printf(" / \\\n");
  1665. printf(" /_______\\\n");
  1666. printf(" |[ ] [ ]|\n");
  1667. printf(" | = |\n");
  1668. score++;
  1669. } else {
  1670. printf("Incorrect. The answer is d.\n\n");
  1671. }
  1672. printf("Question 2: Who invented the telephone?\n\n");
  1673. printf("Hint: He was a Scottish-born American inventor.\n\n");
  1674. printf("Options: a.)Alexander Graham Bell, b.)Thomas Edison, c.)Nikola Tesla, d.)Gutenberg\n\n");
  1675. printf("Answer: ");
  1676. scanf("%s", answer);
  1677. if (strcmp(answer, "a") == 0) {
  1678. printf("Correct! You won a tree.\n\n");
  1679. printf(" *\n");
  1680. printf(" ***\n");
  1681. printf(" *****\n");
  1682. printf(" *******\n");
  1683. printf(" *********\n");
  1684. printf(" ***********\n");
  1685. printf(" *****\n");
  1686. printf(" *****\n");
  1687. printf(" *****\n");
  1688. score++;
  1689. } else {
  1690. printf("Incorrect. The answer is a.\n\n");
  1691. }
  1692. return score;
  1693. }
  1694. int B_round8(void) {
  1695. int score = 0;
  1696. char answer[20];
  1697. printf("Round 8\n\n");
  1698. printf("Question 1: Who played the lead role in the movie 'The Godfather'?\n\n");
  1699. printf("Hint: He is a legendary Hollywood actor.\n\n");
  1700. printf("Options: a.)Marlon Brando, b.)Robert De Niro, c.)Al Pacino, d.)Jack Nicholson\n\n");
  1701. printf("Answer: ");
  1702. scanf("%s", answer);
  1703. if (strcmp(answer, "a") == 0) {
  1704. printf("Correct! You won an Emerald.\n\n");
  1705. printf(" /\\\n / \\ /\\\n / \\ / \\ \n/ \\ \\ \n\\ / / \n \\ / \\ / \n \\ /\\\n \\/\n");
  1706. score++;
  1707. } else {
  1708. printf("Incorrect. The answer is a.\n\n");
  1709. }
  1710. printf("Question 2: Who wrote the play 'Hamlet'?\n\n");
  1711. printf("Hint: He was an English playwright and poet.\n\n");
  1712. printf("Options: a.)William Shakespeare b.)Christopher Marlowe c.)Ben Jonson d.)John Milton\n\n");
  1713. printf("Answer: ");
  1714. scanf("%s", answer);
  1715. if (strcmp(answer, "a") == 0) {
  1716. printf("Correct! You won a bird.\n\n");
  1717. printf(" /\\_/\\\n( o.o )\n > ^ < \n");
  1718. score++;
  1719. } else {
  1720. printf("Incorrect. The answer is a.\n\n");
  1721. }
  1722. return score;
  1723. }
  1724. int B_round9(void) {
  1725. int score = 0;
  1726. char answer[20];
  1727. printf("Round 9\n\n");
  1728. printf("Question 1: The median is the value separating the higher half from the lower half of a data set.\n\n");
  1729. printf("Hint: It is commonly used to represent the center of a dataset.\n\n");
  1730. printf("Options: True, False\n\n");
  1731. printf("Answer: ");
  1732. scanf("%s", answer);
  1733. if (strcmp(answer, "True") == 0) {
  1734. printf("Correct! You won a computer.\n\n");
  1735. printf(" ________________\n");
  1736. printf("| |\n");
  1737. printf("| |\n");
  1738. printf("| |\n");
  1739. printf("| |\n");
  1740. printf("|________________|\n");
  1741. printf(" __________\n");
  1742. printf(" | ________ |\n");
  1743. printf(" | | | |\n");
  1744. printf(" | |______| |\n");
  1745. printf(" |__________|\n");
  1746. score++;
  1747. } else {
  1748. printf("Incorrect. The answer is True.\n\n");
  1749. }
  1750. printf("Question 2: The mode of a data set is the value that occurs most frequently.\n\n");
  1751. printf("Hint: The mode is a statistical measure that represents the most frequently occurring value in a dataset.\n\n");
  1752. printf("Options: True, False\n\n");
  1753. printf("Answer: ");
  1754. scanf("%s", answer);
  1755. if (strcmp(answer, "True") == 0) {
  1756. printf("Correct! You won a tooth.\n\n");
  1757. printf(" ____________\n");
  1758. printf(" / \\\n");
  1759. printf(" / \\\n");
  1760. printf("(______________()\n");
  1761. printf(" \\ ___ /\n");
  1762. printf(" \\ / \\ /\n");
  1763. printf(" \\/ \\/\n");
  1764. score++;
  1765. } else {
  1766. printf("Incorrect. The answer is True.\n\n");
  1767. }
  1768. return score;
  1769. }
  1770. int B_round10(void) {
  1771. int score = 0;
  1772. char answer[20];
  1773. printf("Round 10\n\n");
  1774. printf("Question 1: What is the chemical formula for water?\n\n");
  1775. printf("Hint: It is composed of two hydrogen atoms and one oxygen atom.\n\n");
  1776. printf("Options: CO2, O2, H2O, N2O\n\n");
  1777. printf("Answer: ");
  1778. scanf("%s", answer);
  1779. if (strcmp(answer, "H2O") == 0) {
  1780. printf("Correct! You won a cool shape.\n");
  1781. printf(" ____\n / \\\n/________\\\n\\________/\n \\____/\n");
  1782. score++;
  1783. } else {
  1784. printf("Incorrect. The answer is H2O.\n\n");
  1785. }
  1786. printf("Question 2: Who developed the theory of relativity?\n\n");
  1787. printf("Hint: A German-born physicist.\n\n");
  1788. printf("Options: a.)Isaac Newton b.)Albert Einstein c.)Stephen Hawking d.)Neil deGrasse Tyson\n\n");
  1789. printf("Answer: ");
  1790. scanf("%s", answer);
  1791. if (strcmp(answer, "b") == 0) {
  1792. printf("Correct! You won a rocket.\n\n");
  1793. printf(" /\\\n//\\\\\nV V\n");
  1794. score++;
  1795. } else {
  1796. printf("Incorrect. The answer is b.\n\n");
  1797. }
  1798. return score;
  1799. }
  1800. void B_saythankyou(void){
  1801. printf("Dear player,\nI just wanted to take a moment to thank you for playing my game.\n It means a lot to me that you took the time to experience what I created.\n Your support and feedback are greatly appreciated.\n I hope you had a blast playing and I look forward to hearing more about your experience.\n Thank you again for your support and I hope to see you in future games!\n Best regards.\n\n\n");
  1802. }
  1803. void rate(void){
  1804. int rate;
  1805. printf("What would you rate my game out of 10?\n\n");
  1806. scanf("%d", &rate);
  1807. printf("Thank you for your rating!\n\n");
  1808. printf("Your rating: %d/10\n\n", rate);
  1809. }
  1810. void B_write_review(void) {
  1811. char response;
  1812. char review[100];
  1813. printf("Do you want to write a review (y/n)?\n\n ");
  1814. scanf(" %c", &response);
  1815. if (response == 'y') {
  1816. printf("Please write a one word review: (eg. amazing, cool, etc.)\n\n");
  1817. scanf("%s", review);
  1818. printf("Thank you for your review\n\n");
  1819. } else if (response == 'n') {
  1820. printf("Thank you for your time.\n\n");
  1821. } else {
  1822. printf("Invalid response.\n\n");
  1823. }
  1824. }
  1825. void b_epic_game() {
  1826. B_displayWelcomeMessage();
  1827. b_entertostart();
  1828. B_username();
  1829. B_userinfo();
  1830. B_displayGameInstructions();
  1831. B_show_time();
  1832. int total_score = 0;
  1833. total_score += B_testround();
  1834. total_score += B_round1();
  1835. total_score += B_round2();
  1836. total_score += B_round3();
  1837. total_score += B_round4();
  1838. total_score += B_round5();
  1839. total_score += B_round6();
  1840. total_score += B_round7();
  1841. total_score += B_round8();
  1842. total_score += B_round9();
  1843. total_score += B_round10();
  1844. printf("You scored %d out of 22.\n", total_score);
  1845. B_saythankyou();
  1846. rate();
  1847. B_write_review();
  1848. }
  1849. void v_play_rockpapersciss(){
  1850. int player_choice, computer_choice, player_score = 0, computer_score = 0;
  1851. srand(time(NULL));
  1852. printf("***************************\n");
  1853. printf("Playing Rock,Paper,Scissors!\n");
  1854. printf("***************************\n\n");
  1855. printf("First to win 3 rounds wins!\n\n");
  1856. while (1)
  1857. {
  1858. printf("Enter your choice:\n");
  1859. printf("1. Rock\n2. Paper\n3. Scissors\n\n");
  1860. printf("Your Choice:");
  1861. scanf("%d", &player_choice);
  1862. computer_choice = (rand() % 3) + 1;
  1863. if (player_choice == ROCK)
  1864. {
  1865. if (computer_choice == ROCK)
  1866. {
  1867. printf("\nTie! Both picked Rock\n\n");
  1868. }
  1869. else if (computer_choice == PAPER)
  1870. {
  1871. printf("\nYou lose! I picked Paper\n\n");
  1872. computer_score++;
  1873. printf("You have %d/3 points and I have %d/3 points.\n\n",player_score, computer_score);
  1874. }
  1875. else
  1876. {
  1877. printf("\nYou win! I picked Scissors\n\n");
  1878. player_score++;
  1879. printf("You have %d/3 points and I have %d/3 points.\n\n",player_score, computer_score);
  1880. }
  1881. }
  1882. else if (player_choice == PAPER)
  1883. {
  1884. if (computer_choice == ROCK)
  1885. {
  1886. printf("\nYou win! I picked Rock\n\n");
  1887. player_score++;
  1888. printf("You have %d/3 points and I have %d/3 points.\n\n",player_score, computer_score);
  1889. }
  1890. else if (computer_choice == PAPER)
  1891. {
  1892. printf("\nTie! Both picked Paper\n\n");
  1893. }
  1894. else
  1895. {
  1896. printf("\nYou lose! I picked Scissors\n\n");
  1897. computer_score++;
  1898. printf("You have %d/3 points and I have %d/3 points.\n\n",player_score, computer_score);
  1899. }
  1900. }
  1901. else if (player_choice == SCISSORS)
  1902. {
  1903. if (computer_choice == ROCK)
  1904. {
  1905. printf("\nYou lose! I picked Rock\n\n");
  1906. computer_score++;
  1907. printf("You have %d/3 points and I have %d/3 points.\n\n",player_score, computer_score);
  1908. }
  1909. else if (computer_choice == PAPER)
  1910. {
  1911. printf("\nYou win! I picked Paper\n\n");
  1912. player_score++;
  1913. printf("You have %d/3 points and I have %d/3 points.\n\n",player_score, computer_score);
  1914. }
  1915. else
  1916. {
  1917. printf("\nTie! Both picked Scissors\n\n");
  1918. }
  1919. }
  1920. else
  1921. {
  1922. printf("\nInvalid choice!\n\n");
  1923. }
  1924. if (player_score == 3 || computer_score == 3)
  1925. {
  1926. break;
  1927. }
  1928. }
  1929. if (player_score == 3)
  1930. {
  1931. printf("You win the best of three!\n\n");
  1932. }
  1933. else
  1934. {
  1935. printf("I win the best of three!\n\n");
  1936. }
  1937. printf("******************************************\n");
  1938. printf("Thank you for playing Rock,Paper,Scissors!\n");
  1939. printf("******************************************\n\n");
  1940. }
  1941. void v_horoscope(int day, int month){
  1942. if ((month == 3 && day >= 21) || (month == 4 && day <= 19)) {
  1943. char horo;
  1944. printf("\nYour horoscope is Aries.\n\n");
  1945. printf("Do you want to know more about Aries personalities?\n");
  1946. printf("Your Answer(Y/N): ");
  1947. scanf(" %c", &horo);
  1948. horo = toupper(horo);
  1949. if (horo == 'Y'){
  1950. printf("\nLike their fellow fire signs, Leo and Sagittarius, \nAries is a passionate, motivated, and confident leader who builds community with their cheerful disposition \nand relentless determination. \nUncomplicated and direct in their approach, they often get frustrated by exhaustive details and unnecessary nuances.\n\n");
  1951. }else{
  1952. printf("\nOkay no worries! But you missed the fun!\n\n");
  1953. }
  1954. printf("Do you want to know which Zodiac matches the best with Aries?\n");
  1955. printf("Your Answer(Y/N): ");
  1956. scanf(" %c", &horo);
  1957. horo = toupper(horo);
  1958. if (horo == 'Y'){
  1959. printf("\nThere's never a dull moment between an Aries and Aquarius, which makes their relationship extremely exciting.\n\n");
  1960. }else{
  1961. printf("\nWe all match! I don't believe in it either!\n\n");
  1962. }
  1963. } else if ((month == 4 && day >= 20) || (month == 5 && day <= 20)) {
  1964. char horo;
  1965. printf("\nYour horoscope is Taurus.\n\n");
  1966. printf("Do you want to know more about Taurus personalities?\n");
  1967. printf("Your Answer(Y/N): ");
  1968. scanf(" %c", &horo);
  1969. horo = toupper(horo);
  1970. if (horo == 'Y'){
  1971. printf("\nTaureans aren't afraid to roll up their sleeves \nand work hard to earn big rewards. \nThey're ambitious, focused, and resilient and they feel most secure \nwhen steadily putting money into a savings account.\n\n");
  1972. }else{
  1973. printf("\nOkay no worries! But you missed the fun!\n\n");
  1974. }
  1975. printf("Do you want to know which Zodiac matches the best with Taurus?\n");
  1976. printf("Your Answer(Y/N): ");
  1977. scanf(" %c", &horo);
  1978. horo = toupper(horo);
  1979. if (horo == 'Y'){
  1980. printf("\nTaurus and Cancer seriously get each other. \nThese two zodiac signs work well with one another because they hold a tight connection both physically and emotionally. \n\n");
  1981. }else{
  1982. printf("\nWe all match! I don't believe in it either!\n\n");
  1983. }
  1984. } else if ((month == 5 && day >= 21) || (month == 6 && day <= 20)) {
  1985. char horo;
  1986. printf("\nYour horoscope is Gemini.\n\n");
  1987. printf("Do you want to know more about Gemini personalities?\n");
  1988. printf("Your Answer(Y/N): ");
  1989. scanf(" %c", &horo);
  1990. horo = toupper(horo);
  1991. if (horo == 'Y'){
  1992. printf("\nPlayful and intellectually curious, Gemini is constantly juggling a variety of passions, \nhobbies, careers, and friend groups. \nThey are the social butterflies of the zodiac: \nThese quick-witted twins can talk to anyone about anything. \nFind them buzzing between happy hours, dinner parties, and dance floors.\n\n");
  1993. }else{
  1994. printf("\nOkay no worries! But you missed the fun!\n\n");
  1995. }
  1996. printf("Do you want to know which Zodiac matches the best with Gemini?\n");
  1997. printf("Your Answer(Y/N): ");
  1998. scanf(" %c", &horo);
  1999. horo = toupper(horo);
  2000. if (horo == 'Y'){
  2001. printf("\nA Gemini and Aquarius have a crazy mental and emotional connection. \nThey get each other to the fullest, like they have known one another for years \neven if it's only been months (or weeks). \n\n");
  2002. }else{
  2003. printf("\nWe all match! I don't believe in it either!\n\n");
  2004. }
  2005. } else if ((month == 6 && day >= 21) || (month == 7 && day <= 22)) {
  2006. char horo;
  2007. printf("\nYour horoscope is Cancer.\n\n");
  2008. printf("Do you want to know more about Cancer personalities?\n");
  2009. printf("Your Answer(Y/N): ");
  2010. scanf(" %c", &horo);
  2011. horo = toupper(horo);
  2012. if (horo == 'Y'){
  2013. printf("\nCancer is the fourth sign of the zodiac and is represented by the Crab. \nThey're primarily known for being emotional, nurturing, and highly intuitive, \nas well as sensitive and at times insecure\n\n");
  2014. }else{
  2015. printf("\nOkay no worries! But you missed the fun!\n\n");
  2016. }
  2017. printf("Do you want to know which Zodiac matches the best with Cancer?\n");
  2018. printf("Your Answer(Y/N): ");
  2019. scanf(" %c", &horo);
  2020. horo = toupper(horo);
  2021. if (horo == 'Y'){
  2022. printf("\nCancer and Pisces are two cool water signs and instinctively have one massive cosmic connection. \nThey work well together because each one knows just who the other is and they are proud of that.\n\n");
  2023. }else{
  2024. printf("\nWe all match! I don't believe in it either!\n\n");
  2025. }
  2026. } else if ((month == 7 && day >= 23) || (month == 8 && day <= 22)) {
  2027. char horo;
  2028. printf("\nYour horoscope is Leo.\n\n");
  2029. printf("Do you want to know more about Leo personalities?\n");
  2030. printf("Your Answer(Y/N): ");
  2031. scanf(" %c", &horo);
  2032. horo = toupper(horo);
  2033. if (horo == 'Y'){
  2034. printf("\nTypical sun in Leo traits include being confident, comfortable being the center of attention, \ndrama-adoring, ambitious, loyal, fiercely protective of their nearest and dearest, \ngenerous, luxury-loving, sunny, and big-hearted.\n\n");
  2035. }else{
  2036. printf("\nOkay no worries! But you missed the fun!\n\n");
  2037. }
  2038. printf("Do you want to know which Zodiac matches the best with Leo?\n");
  2039. printf("Your Answer(Y/N): ");
  2040. scanf(" %c", &horo);
  2041. horo = toupper(horo);
  2042. if (horo == 'Y'){
  2043. printf("\nThe passion is high between Leo and Sagittarius, as both signs both enjoy life and love others who feel the same. \nThey are both passionate about what they want out of this world \nand extremely encouraging in helping the other achieve any goal or dream.\n\n");
  2044. }else{
  2045. printf("\nWe all match! I don't believe in it either!\n\n");
  2046. }
  2047. } else if ((month == 8 && day >= 23) || (month == 9 && day <= 22)) {
  2048. char horo;
  2049. printf("\nYour horoscope is Virgo.\n\n");
  2050. printf("Do you want to know more about Virgo personalities?\n");
  2051. printf("Your Answer(Y/N): ");
  2052. scanf(" %c", &horo);
  2053. horo = toupper(horo);
  2054. if (horo == 'Y'){
  2055. printf("\nVirgos are logical, practical, and systematic in their approach to life. \nThis earth sign is a perfectionist at heart and isn't afraid to improve skills through diligent and consistent practice.\n\n");
  2056. }else{
  2057. printf("\nOkay no worries! But you missed the fun!\n\n");
  2058. }
  2059. printf("Do you want to know which Zodiac matches the best with Virgo?\n");
  2060. printf("Your Answer(Y/N): ");
  2061. scanf(" %c", &horo);
  2062. horo = toupper(horo);
  2063. if (horo == 'Y'){
  2064. printf("\nAs both are earth signs, Virgo and Taurus really hit it off. \nEasygoing and practical in their everyday lives, their relationship is cool, calm and collected.\n\n");
  2065. }else{
  2066. printf("\nWe all match! I don't believe in it either!\n\n");
  2067. }
  2068. } else if ((month == 9 && day >= 23) || (month == 10 && day <= 22)) {
  2069. char horo;
  2070. printf("\nYour horoscope is Libra.\n\n");
  2071. printf("Do you want to know more about Libra personalities?\n");
  2072. printf("Your Answer(Y/N): ");
  2073. scanf(" %c", &horo);
  2074. horo = toupper(horo);
  2075. if (horo == 'Y'){
  2076. printf("\nLibras are extremely agreeable and honest people \nwho believe strongly in the importance of social connections. \nLibras are among the most fascinating and intelligent individuals on the planet, \nand they have a lot to give.\n\n");
  2077. }else{
  2078. printf("\nOkay no worries! But you missed the fun!\n\n");
  2079. }
  2080. printf("Do you want to know which Zodiac matches the best with Libra?\n");
  2081. printf("Your Answer(Y/N): ");
  2082. scanf(" %c", &horo);
  2083. horo = toupper(horo);
  2084. if (horo == 'Y'){
  2085. printf("\nA relationship between a Libra and Gemini is all about a strong intellectual connection. \nBoth are air signs and deep into mental stimulation.\n\n");
  2086. }else{
  2087. printf("\nWe all match! I don't believe in it either!\n\n");
  2088. }
  2089. } else if ((month == 10 && day >= 23) || (month == 11 && day <= 21)) {
  2090. char horo;
  2091. printf("\nYour horoscope is Scorpio.\n\n");
  2092. printf("Do you want to know more about Scorpio personalities?\n");
  2093. printf("Your Answer(Y/N): ");
  2094. scanf(" %c", &horo);
  2095. horo = toupper(horo);
  2096. if (horo == 'Y'){
  2097. printf("\nScorpios are known for their loyalty and devotion — and also their passion. \nIn fact, they are known to have such intense personalities that they are often confused with vibrant fire signs. \nAlas, they just have deep feelings and emotions.\n\n");
  2098. }else{
  2099. printf("\nOkay no worries! But you missed the fun!\n\n");
  2100. }
  2101. printf("Do you want to know which Zodiac matches the best with Scorpio?\n");
  2102. printf("Your Answer(Y/N): ");
  2103. scanf(" %c", &horo);
  2104. horo = toupper(horo);
  2105. if (horo == 'Y'){
  2106. printf("\nSometimes having two passionate people in a relationship doesn't work. \nHowever, if one person is a Scorpio and the other is a Cancer, it can be perfect. \nThese two water signs are intense when it comes to emotions, but that only seems to make them even more compatible.\n\n");
  2107. }else{
  2108. printf("\nWe all match! I don't believe in it either!\n\n");
  2109. }
  2110. } else if ((month == 11 && day >= 22) || (month == 12 && day <= 21)) {
  2111. char horo;
  2112. printf("\nYour horoscope is Sagittarius.\n\n");
  2113. printf("Do you want to know more about Sagittarius personalities?\n");
  2114. printf("Your Answer(Y/N): ");
  2115. scanf(" %c", &horo);
  2116. horo = toupper(horo);
  2117. if (horo == 'Y'){
  2118. printf("\nRepresented by the archer (a half-man, half-horse centaur), \nSagittarius isn't afraid to use its bow and arrow to explore expansive terrain, \nseeking answers in places and spaces others wouldn't dare venture.\n\n");
  2119. }else{
  2120. printf("\nOkay no worries! But you missed the fun!\n\n");
  2121. }
  2122. printf("Do you want to know which Zodiac matches the best with Sagittarius?\n");
  2123. printf("Your Answer(Y/N): ");
  2124. scanf(" %c", &horo);
  2125. horo = toupper(horo);
  2126. if (horo == 'Y'){
  2127. printf("\nSagittarius and Aries are both fire signs, \nso you can expect some serious hot passion between the two, making for a dynamite pair. \nThey have insane amounts of energy to bring into the relationship, \nwhich only grows stronger as it continues to blossom. \n\n");
  2128. }else{
  2129. printf("\nWe all match! I don't believe in it either!\n\n");
  2130. }
  2131. } else if ((month == 12 && day >= 22) || (month == 1 && day <= 19)) {
  2132. char horo;
  2133. printf("\nYour horoscope is Capricorn.\n\n");
  2134. printf("Do you want to know more about Capricorn personalities?\n");
  2135. printf("Your Answer(Y/N): ");
  2136. scanf(" %c", &horo);
  2137. horo = toupper(horo);
  2138. if (horo == 'Y'){
  2139. printf("\nCapricorns are overachievers, persistent, practical, and sensitive. \nThey're known for their hardworking habits, and they're overachievers who make success look effortless \n— even though they put a lot of time and care into their careers and relationships.\n\n");
  2140. }else{
  2141. printf("\nOkay no worries! But you missed the fun!\n\n");
  2142. }
  2143. printf("Do you want to know which Zodiac matches the best with Capricorn?\n");
  2144. printf("Your Answer(Y/N): ");
  2145. scanf(" %c", &horo);
  2146. horo = toupper(horo);
  2147. if (horo == 'Y'){
  2148. printf("\nCapricorn and Taurus have something most only daydream about: endless adoration. \nThese two lovebirds will be together forever and actually enjoy one another's company to the end.\n\n");
  2149. }else{
  2150. printf("\nWe all match! I don't believe in it either!\n\n");
  2151. }
  2152. } else if ((month == 1 && day >= 20) || (month == 2 && day <= 18)) {
  2153. char horo;
  2154. printf("\nYour horoscope is Aquarius.\n\n");
  2155. printf("Do you want to know more about Aquarius personalities?\n");
  2156. printf("Your Answer(Y/N): ");
  2157. scanf(" %c", &horo);
  2158. horo = toupper(horo);
  2159. if (horo == 'Y'){
  2160. printf("\nAquarius is actually the final air sign, which means it deals with air-related concepts from a macro-perspective. \nOf all the zodiac signs, Aquarius is undoubtedly the most innovative, progressive, rebellious, and humanitarian.\n\n");
  2161. }else{
  2162. printf("\nOkay no worries! But you missed the fun!\n\n");
  2163. }
  2164. printf("Do you want to know which Zodiac matches the best with Aquarius?\n");
  2165. printf("Your Answer(Y/N): ");
  2166. scanf(" %c", &horo);
  2167. horo = toupper(horo);
  2168. if (horo == 'Y'){
  2169. printf("\nAquarius and Gemini are both air signs that have a killer psychological connection. \nAnd it goes deep—really deep, like finishing each other's sentences. \nTheir relationship is almost mystical because it's one no one else can comprehend.\n\n");
  2170. }else{
  2171. printf("\nWe all match! I don't believe in it either!\n\n");
  2172. }
  2173. } else if ((month == 2 && day >= 19) || (month == 3 && day <= 20)) {
  2174. char horo;
  2175. printf("\nYour horoscope is Pisces.\n\n");
  2176. printf("Do you want to know more about Pisces personalities?\n");
  2177. printf("Your Answer(Y/N): ");
  2178. scanf(" %c", &horo);
  2179. horo = toupper(horo);
  2180. if (horo == 'Y'){
  2181. printf("\nPisces people are known for being emotionally sensitive, gracious, and emotionally aware. \nPisces characters are regarded for being among the most sympathetic of the zodiac signs, \nand they will go to great lengths to ensure the happiness of those around them. \nThey're also creative and imaginative.\n\n");
  2182. }else{
  2183. printf("\nOkay no worries! But you missed the fun!\n\n");
  2184. }
  2185. printf("Do you want to know which Zodiac matches the best with Pisces?\n");
  2186. printf("Your Answer(Y/N): ");
  2187. scanf(" %c", &horo);
  2188. horo = toupper(horo);
  2189. if (horo == 'Y'){
  2190. printf("\nAnother pair that's very intuitive to one another is Pisces and Scorpio. \nThese two zodiac signs can get into each other's minds \nand know what they are thinking almost as well as if they were thinking it themselves. \nBut they aren't just into intellect; \nthey both have a hunger to understand the other's body and soul \nand learn what makes the other person tick.\n\n");
  2191. }else{
  2192. printf("\nWe all match! I don't believe in it either!\n\n");
  2193. }
  2194. } else {
  2195. printf("Invalid birth date.\n");
  2196. }
  2197. }
  2198. void v_play_horoscope(void) {
  2199. int day, month;
  2200. printf("*********************\n");
  2201. printf("Check your Horoscope!\n");
  2202. printf("*********************\n\n");
  2203. printf("Enter your birth day: ");
  2204. scanf("%d", &day);
  2205. printf("Enter your birth month (in number): ");
  2206. scanf("%d", &month);
  2207. v_horoscope(day, month);
  2208. printf("****************\n");
  2209. printf("Have a nice day!\n");
  2210. printf("****************\n\n");
  2211. }
  2212. void feedbackForm(void){
  2213. int rating;
  2214. char feedback[1000];
  2215. printf("\nQuick Feedback Form:\n\n");
  2216. printf("On a scale of 1 to 5, how would you rate the quiz? (1 being poor and 5 being excellent): ");
  2217. scanf("%d", &rating);
  2218. getchar();
  2219. printf("Please provide any additional feedback: ");
  2220. fgets(feedback, sizeof(feedback), stdin);
  2221. printf("\nThank you for your feedback!\n");
  2222. printf("Your rating: %d/5\n", rating);
  2223. printf("Your feedback: %s\n", feedback);
  2224. }
  2225. void displayCredits(void) {
  2226. printf("*******************************\n");
  2227. printf("Thank you for playing our Game!\n");
  2228. printf("*******************************\n\n");
  2229. printf("This game was developed as a project for Hochschule Fulda. \nCreated by Vedant Bodhe, Emmanuel Afanyede, Berke Sevenler and Gabriel Tchakunte.\n\n");
  2230. printf("Special thanks to:\n");
  2231. printf("- Herr Thomas Papendieck (Lecturer: Programmiermethoden)\n");
  2232. printf("- Frau Monika Schak (Lecturer: Programming-1 in C)\n");
  2233. }
  2234. void progress_bar(int percentage)
  2235. {
  2236. printf("\r[");
  2237. for (int i = 0; i < 50; i++)
  2238. {
  2239. if (i < (percentage / 2))
  2240. {
  2241. printf(">");
  2242. }
  2243. else
  2244. {
  2245. printf(" ");
  2246. }
  2247. }
  2248. printf("] %d%%", percentage);
  2249. fflush(stdout);
  2250. }
  2251. void v_progress_bar(int argc, char *argv[]){
  2252. for (int i = 0; i <= 100; i++)
  2253. {
  2254. progress_bar(i);
  2255. usleep(100000);
  2256. }
  2257. printf("\n");
  2258. }
  2259. int main(int argc, char *argv[]) {
  2260. int choice;
  2261. printf("Welcome to the Game Menu!\n");
  2262. printf("\t\t----------------------------\n\n");
  2263. printf("\t\t----------------------------\n\n");
  2264. printf("\t\t Welcome! \n\n");
  2265. printf("\t\t----------------------------\n");
  2266. printf("\t\t----------------------------\n\n");
  2267. printf("\t\tPress 'Enter' to join the Game \n");
  2268. char joinGame;
  2269. scanf("%c", &joinGame);
  2270. joinGame = toupper(joinGame);
  2271. if (joinGame != ' ') {
  2272. char vorName[100] ={0};
  2273. char nachName[100] ={0};
  2274. printf("\t\tPlease enter your First Name \n");
  2275. scanf("%s", vorName);
  2276. printf("\t\tPlease enter your Surname \n");
  2277. scanf("%s", nachName);
  2278. printf("\t\t------------------------------------------\n\n");
  2279. printf("\t\t------------------------------------------\n\n");
  2280. printf("\t\t Hello %s %s! \n\n", vorName, nachName);
  2281. printf("\t\t------------------------------------------\n\n");
  2282. printf("\t\t------------------------------------------\n\n");
  2283. printf("\n\nPlease choose one of the number options from below\n\n");
  2284. }
  2285. int jump_to_menu = 0;
  2286. while (choice != 8 || jump_to_menu) {
  2287. printf("Welcome to the Game Menu!\n");
  2288. printf("1. QuizGame\n");
  2289. printf("2. Fact or Lie?\n");
  2290. printf("3. Who wants to be a millionaire\n");
  2291. printf("4. Guess the Number!\n");
  2292. printf("5. Guess the Word!\n");
  2293. printf("6. Smart Brain\n");
  2294. printf("7. Epic Game\n");
  2295. printf("8. Rock,Paper,Scissors!\n");
  2296. printf("9. Math Quiz\n");
  2297. printf("10. Check your Horoscope!\n");
  2298. printf("11. Exit\n");
  2299. printf("Enter your choice: ");
  2300. scanf("%d", &choice);
  2301. v_progress_bar(argc,argv);
  2302. switch(choice) {
  2303. case 1:
  2304. play_quizgame();
  2305. jump_to_menu = 1;
  2306. break;
  2307. case 2:
  2308. play_factorlie();
  2309. jump_to_menu = 1;
  2310. break;
  2311. case 3:
  2312. play_milliongame();
  2313. jump_to_menu = 1;
  2314. break;
  2315. case 4:
  2316. play_guessingGame();
  2317. jump_to_menu = 1;
  2318. break;
  2319. case 5:
  2320. play_guessTheWord();
  2321. jump_to_menu = 1;
  2322. break;
  2323. case 6:
  2324. e_smart_brain();
  2325. jump_to_menu = 1;
  2326. break;
  2327. case 7:
  2328. b_epic_game();
  2329. jump_to_menu = 1;
  2330. break;
  2331. case 8:
  2332. v_play_rockpapersciss();
  2333. jump_to_menu = 1;
  2334. break;
  2335. case 9:
  2336. math_enter_game();
  2337. jump_to_menu = 1;
  2338. break;
  2339. case 10:
  2340. v_play_horoscope();
  2341. jump_to_menu = 1;
  2342. break;
  2343. case 11:
  2344. printf("\nThank you for trying our C code!\n");
  2345. break;
  2346. default:
  2347. printf("Invalid choice!\n");
  2348. }
  2349. if (jump_to_menu) {
  2350. jump_to_menu = 0;
  2351. printf("\nType any key and press enter to jump back to the menu.\n");
  2352. char jump_key;
  2353. scanf(" %c", &jump_key);
  2354. jump_key = toupper(jump_key);
  2355. v_progress_bar(argc,argv);
  2356. }
  2357. }
  2358. feedbackForm();
  2359. displayCredits();
  2360. return 0;
  2361. }