|
@ -26,25 +26,7 @@ int* randomNumber() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void displayWelcomeMessage(void) { |
|
|
void displayWelcomeMessage(void) { |
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
|
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
|
|
|
printf("\t\t Welcome to The Quiz \n\n"); |
|
|
|
|
|
printf("\t\t------------------------------------------\n"); |
|
|
|
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
|
|
|
printf("\t\t Press 'Enter' to join the Game \n"); |
|
|
|
|
|
char joinGame; |
|
|
|
|
|
scanf("%c", &joinGame); |
|
|
|
|
|
joinGame = toupper(joinGame); |
|
|
|
|
|
if (joinGame != ' ') { |
|
|
|
|
|
char vorName[100] ={0}; |
|
|
|
|
|
char nachName[100] ={0}; |
|
|
|
|
|
printf("\t\t Please enter your First Name \n"); |
|
|
|
|
|
scanf("%s", vorName); |
|
|
|
|
|
printf("\t\t Please enter your Surname \n"); |
|
|
|
|
|
scanf("%s", nachName); |
|
|
|
|
|
displayGameInstructions(vorName, nachName); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
displayGameInstructions(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void displayGoodLuckMessage(void) { |
|
|
void displayGoodLuckMessage(void) { |
|
@ -55,10 +37,10 @@ void displayGoodLuckMessage(void) { |
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void displayGameInstructions(char vorName[], char nachName[]) { |
|
|
|
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
|
|
|
|
|
|
void displayGameInstructions(void) { |
|
|
|
|
|
printf("\t\t------------------------------------------\n"); |
|
|
|
|
|
printf("\t\t Welcome to Quiz Game!\n\n"); |
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
printf("\t\t Hello %s %s! \n\n", vorName, nachName); |
|
|
|
|
|
printf("\t\t To start this game, here are the Instructions\n\n"); |
|
|
printf("\t\t To start this game, here are the Instructions\n\n"); |
|
|
printf("\t\t------------------------------------------\n"); |
|
|
printf("\t\t------------------------------------------\n"); |
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
printf("\t\t------------------------------------------\n\n"); |
|
@ -304,7 +286,7 @@ void ask_hard_questions(void) { |
|
|
int *lessFive = randomNumber(); |
|
|
int *lessFive = randomNumber(); |
|
|
int arr[5]; |
|
|
int arr[5]; |
|
|
int p = 0; |
|
|
int p = 0; |
|
|
for(int i = 0; i < 11; i++){ |
|
|
|
|
|
|
|
|
for(int i = 0; i < 13; i++){ |
|
|
if(lessFive[i] < 5){ |
|
|
if(lessFive[i] < 5){ |
|
|
arr[p] = lessFive[i]; |
|
|
arr[p] = lessFive[i]; |
|
|
p++; |
|
|
p++; |
|
@ -441,7 +423,7 @@ void displayThankYouMessage(void) { |
|
|
void play_quizgame(void){ |
|
|
void play_quizgame(void){ |
|
|
displayInstructions(); |
|
|
displayInstructions(); |
|
|
|
|
|
|
|
|
printf(">>Press 's' and Enter start the Game<<\n"); |
|
|
|
|
|
|
|
|
printf(">>Press 's' and Enter to start the Game<<\n"); |
|
|
char var, var1 = 's'; |
|
|
char var, var1 = 's'; |
|
|
getchar(); |
|
|
getchar(); |
|
|
while(var != var1) { |
|
|
while(var != var1) { |
|
@ -467,6 +449,30 @@ void play_game3() { |
|
|
|
|
|
|
|
|
int main() { |
|
|
int main() { |
|
|
int choice; |
|
|
int choice; |
|
|
|
|
|
printf("Welcome to the Game Menu!\n"); |
|
|
|
|
|
printf("\t\t----------------------------\n\n"); |
|
|
|
|
|
printf("\t\t----------------------------\n\n"); |
|
|
|
|
|
printf("\t\t Welcome! \n\n"); |
|
|
|
|
|
printf("\t\t----------------------------\n"); |
|
|
|
|
|
printf("\t\t----------------------------\n\n"); |
|
|
|
|
|
printf("\t\tPress 'Enter' to join the Game \n"); |
|
|
|
|
|
char joinGame; |
|
|
|
|
|
scanf("%c", &joinGame); |
|
|
|
|
|
joinGame = toupper(joinGame); |
|
|
|
|
|
if (joinGame != ' ') { |
|
|
|
|
|
char vorName[100] ={0}; |
|
|
|
|
|
char nachName[100] ={0}; |
|
|
|
|
|
printf("\t\tPlease enter your First Name \n"); |
|
|
|
|
|
scanf("%s", vorName); |
|
|
|
|
|
printf("\t\tPlease enter your Surname \n"); |
|
|
|
|
|
scanf("%s", nachName); |
|
|
|
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
|
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
|
|
|
printf("\t\t Hello %s %s! \n\n", vorName, nachName); |
|
|
|
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
|
|
|
printf("\t\t------------------------------------------\n\n"); |
|
|
|
|
|
printf("\n\nPlease choose one of the number options from below\n\n"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
printf("Welcome to the Game Menu!\n"); |
|
|
printf("Welcome to the Game Menu!\n"); |
|
|
printf("1. QuizGame\n"); |
|
|
printf("1. QuizGame\n"); |
|
|