Hello I've joined (after using this for some REALLY random things) because I've thought I may try really making something like a game/semi large program. (I'm still really new to this... so..) I'm not trying anything too hard, Its just a text game, anyways heres the code.
Code:
int main() // The First room
{
char *Op; // The whole Operation for the First part of the game
bool FirstRoom; // First room
char *yourName;
FirstRoom = false;
printf ("Please Input your name (Up to 32 Characters):\n"); // Inputing your name
scanf ("%c", yourName);
printf ("I'm stuck in a small building... I see no way of getting out. But I need to anyways.\n"); // Opening dialogue
while ( FirstRoom == false || Op == look at room || Op == examine room)
{
printf("\nI see some spoons and something red half buried in the ground, One part of the wall is reenforced wood... no way to brake thru.\n");
scanf("%c", Op);
if (Op == look at wood || examine wood || look at wood wall || examine wood wall)
{
printf("\nIts been nailed down tight... I'd have to have explosves to get thru it...\n");
scanf("%c", Op);
}
else if (Op == tackle wood || attack wood || kick wood || tackle wood wall || attack wood wall || kick wood wall)
{
printf("\nI get up the guts (or stupidty) to attack the reenforced wood... Ramming it with all my might. I hear a Thud! then a Crack! I look up... just to see I stepped in something on the floor.\n");
scanf("%c", Op);
}
else if (Op == look at spoons || examine spoons)
{
printf("\nThere... spoons.. What else do you want me to say?\n");
scanf("%c", Op);
}
else if (Op == look at red || examine red || look at red thing || examine red thing)
{
printf("\nI can't tell what it is... I don't really want to mess with it due to I might need it...\n");
scanf("%c", Op);
}
else if (Op == dig up red || dig up red thing)
{
printf("\nThe ground is WAY to hard for my hands to dig it up...\n");
scanf("%c", Op);
}
else if (Op == pull up red || pull up red thing || pick up red || pick up red thing)
{
printf("\nI don't want to try... I may damage whatever it is, and I may need it.\n");
scanf("%c", Op);
}
else if (Op == take spoons || pick up spoons || grab spoons || get spoons)
{
printf("\nI took the spoons... WoW.. arnt I great..\n");
scanf("%c", Op);
}
else
{
printf("\nI'm sorry I either don't understand what you want me to do or your just making no since... (I'm not perfect...)\n");
scanf("%c", Op);
}
return 0;
}
I know it has something to do with the way that I'm trying to do the Op but I'm not sure if I'll need to make int for all of them or if there's an easier way to do this.
Thanks
Noyesdude