How can I make this to continue until the user presses N? I've tried using while(1), while( option == 'y' || option == 'Y') but it kept giving an error for that, and if/else statements but no luck. So I decided to try a do while statement and same results, it seems it is working, but I don't know what I'm doing wrong. I even tried moving all the statements to different areas and still nothing.
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
enum meme {YEE, KNUCKLES, DOGE, HARAMBE, BUTKUS};
int dankestmemes(void); // function prototype
int main(void) {
srand(time(NULL)); // randomize random generator using current time
enum meme dankMeme; // can contain YEE, WAE, DOGE, HARAMBE, or BUTKUS
int dank = dankestmemes(); // When program first executes
char option;
do{
switch(dank){
case 0: // You will be put in the Yee dinosaur tribe
dankMeme = YEE; // Possibly the greatest meme in existance
printf("Yee. Where the most obnoxious beings reside. Here you \n"); // I recommend watching the YouTube video
printf("well endure endless singing.\n"); // https://www.youtube.com/watch?v=q6EoRBvdVPQ
break;
case 1: // You will be put in the Ugandan Knuckles tribe
dankMeme = KNUCKLES; // #EBOLA
printf("Ugandan Knuckles. Welcome my brutha, here you will find those \n");
printf("who are adventurous. We strive to find our queen and da wae.\n");
break;
case 2: // u will b put in tribe of Doge
dankMeme = DOGE;
printf("DOGE. PPL IN THS TRIBE ARE MUCH WOW VERY AMAZE\n");
break;
case 3: // You will be put in the tribe of Harambe
dankMeme = HARAMBE; // RIP in Peace sweet prince
printf("Harambe! Here you will feel the presence of his amazing grace. Only the wise and strong reside in this tribe. ");
printf("No wonder why this tribe is everyone's favorite.\n");
break;
case 4: // You will be put in the tribe of Butkus
dankMeme = BUTKUS; // WWBD
printf("Butkus. This tribe is full of inconsequential people whos aura\n ");
printf("affects those around them. You cannot escape the Butkus!\n");
break;
} // End of switch
printf("Want to be resorted? Y/N: "); // asks if user wants to go again
// option = getchar();
scanf("%c", &option); // executes input
if(option == 'y' || option == 'Y'){ // program will go again if yes is selected
continue;
}
else{ // if no is selected program will break
break;
}
}
while (option != 'y' || option != 'Y');
} // End of main
int dankestmemes(void){ //Starts when program is executed
int memeInjections = rand() % 5; // Helps to randomize the outcome
printf("You belong in the Tribe of "), memeInjections;
return memeInjections;
} // end of dankestmemes function
Output:
You belong in the Tribe of Ugandan Knuckles. Welcome my brutha, here you will find those
who are adventurous. We strive to find our queen and da wae.
Want to be resorted? Y/N: y
Ugandan Knuckles. Welcome my brutha, here you will find those
who are adventurous. We strive to find our queen and da wae.
Want to be resorted? Y/N:
root@fyve:~$