OK so here is the code and the only problem it says is there is wrong syntax for the input in the main function.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//Second option for all if statements are not working unless they redirect to another class.//
void KingAlbertsArmy(){
printf("You enlisted in the King's army at age 16.\n");
}
void Rebels(){
printf("You are constantly moving around from village to village\n gathering as many people as you can to fight the king.\n");
}
void Martyr(){
printf("Living your early childhood years as a choirboy you eventually became the father of the church.\n");
}
void Chapter1(){
int allianceselection;
int kingalbertsarmy = 1;
int rebels = 2;
int martyr = 3;
printf("King Albert has an army that is killing everyone that oppose and do not worship him.\n");
printf("Which side will you fight for; enlist in the King's Army or fight with the Rebels for freedom.\n");
printf("..or fight for your beliefs as a Martyr.\n");
printf("Who will you fight for.\n");
printf("1. King Albert's Army.\n");
printf("2. Rebels.\n");
printf("3. Martyr.\n");
scanf("%d", &allianceselection);
if(allianceselection == kingalbertsarmy){
KingAlbertsArmy();
}
else if(allianceselection == rebels){
Rebels();
}
else if(allianceselection == martyr){
Martyr();
}
}
void Backstory(){
printf("You choose to receive backstory...well there isn't much of that at all.\n");
printf("The little backstory that is available is that King Albert is on a vicious rampage,\n");
printf(" killing all that oppose or do not worship him.\n");
Chapter1();
void StartingOut(){
int backstoryselection;
int yes = 1;
int no = 2;
printf("Would you like backstory?\n");
printf("1. Yes.\n");
printf("2. No.\n");
scanf("%d", &backstoryselection);
if(backstoryselection == yes){
Backstory();
}
else if(backstoryselection == no){
Chapter1();
}
}
void Exit(){
printf(" Now Closing\n ");
}
void Multiplayer() {
printf(" Loading Multiplayer Option\n ");
printf(" Multiplayer Option isn't available at the moment.\n");
}
void Play() {
printf(" Play\n ");
StartingOut();
}
void Load() {
int loadnot;
int loadnotnewgameyes = 1;
int loadnotexityes = 2;
printf(" Load\n ");
printf(" Must have a saved game to load.\n");
printf(" Would you like to start a new game or exit?\n");
printf(" 1. Start New Game.\n");
printf(" 2. Exit.\n");
scanf("%d", &loadnot);
if(loadnot == loadnotnewgameyes){
Play();
}
else if(loadnot == loadnotexityes){
Exit();
}
}
void MainMenu() {
int gameselectioninput;
int playgame = 1;
int loadgame = 2;
int loadmultiplayeroption = 3;
int exit = 4;
printf(" Created By: Anthony Brown. \n");
printf(" \n");
printf(" Ravages \n");
printf("1. Play Game\n");
printf("2. Load Game\n");
printf("3. Load Multiplayer Option\n");
printf("4. Exit\n");
printf(" Enter Selection Number \n");
scanf("%d", &gameselectioninput);
if( gameselectioninput == playgame){
Play();
}
else if ( gameselectioninput == loadgame){
Load();
}
else if ( gameselectioninput == loadmultiplayeroption){
Multiplayer();
}
else if ( gameselectioninput == exit){
Exit();
}
}
int main()
{
MainMenu();
getchar();
return 0;
}
I don't know what's wrong with it. Please help me.