furry.ca forum
furry.ca forum
home to furry.ca search furry.ca forum members of furry.ca forum help topics

February 04, 2012, 05:50:16 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: The forum's rules are posted in the announcements board! Be sure to read them! Smiley
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Programming help... ;-;  (Read 841 times)
0 Members and 1 Guest are viewing this topic.
SenSint
fuzzy wuzzy

Kitsune-Neko-Wolf kit-pup

**
Offline Offline

Gender: Male
Ajax, Ontario
Posts: 70


« on: October 30, 2009, 09:24:37 AM »

Ok..... I've tried like everything to get this to work but I fail at C programming I'm trying to make a simple choice game with if statements in C. the teacher says it's right but it doesn't choose any other value other than 0 until the values before that show their if statement....
#include "stdafx.h"

#include <stdio.h>
#include <conio.h>
int main(void)
{
   char name [20+1];
   int age, story;
   
   printf("Please input your name: ");
   scanf("%s", &name);
   printf("Your name is: %s", name);

   printf("\n\n%s please input your age: ", name);
   scanf("%d", &age);
   printf("Your age is: %d", age);

   printf("\n\nPlease select your story, 0 for house, 1 for beach, 2 to end the story: ");
   scanf("%d", &story);



   {
      if (story == 0)
         printf("\nYou have chosen house.");

         printf("\n%s will you go Left (0)\nOr\nRight (1)?\n", name);
         int choice1;
         fflush(stdin);
         scanf("%d", &choice1);
      {
         if (choice1 == 0)
            
            printf("\n%s there is a locked door, what will you do?\nLeave it be (0)\nBreak the window (1)\nExit the game (2)\n", name);
            int choice2;
            scanf("%d", &choice2);
            fflush(stdin);

         {
            if (choice2 == 0)
               
               printf("%s you see the key to the door is in a mousehole beside the door. It is too deep for you to just reach in and grab it.\n\nWill you:\nUse a stick to knock it out. (0)\nOr\nWalk away (1)\nTo quit press (2)\n", name);
               int choice3;
               scanf("%d", &choice3);

         
            {
               if (choice3 == 0)
               
                  printf("\nAlong with knocking out the key you get splashed with a strange liquid. You notice you're body is changing and you are becoming an anthromorphic (Please enter an animal here and press ENTER) ");
                  char fur [20+1];
                  scanf("%s", &fur);
                  printf("\n%s you are turning into a %s.", name, fur);
                  printf("\nAre you a:\nSmall anthromorphic animal (0)\n");
            }
         }
      }
   }

   {
      if (story == 1)
         printf("\n%s there is a nice beach out in front of you... with many crabs. How are you going to deal with them?\nGonna smash them with my hammer! (0)\nScare all the seagulls to them (1)\n Quit the game (2)");
         int choice1;
         scanf("%d", choice1);

         {
            if (choice1 == 0)
               printf("\n%s you smash the crabs into the sand with the heavy hammer and then you feel a rumble from underneath the ground.\nThe rumble is caused by a..... Giant turtle... ", name);

   }
   
   {
      if (story == 2)
         printf("\nYou have chosen to end the story, please hit ENTER\n");
   }
   getch();
   return 0;
}
that's the program that I have..... if anyone who knows what I'm doing wrong could help me I'd be very grateful....... *gives 'lil kit eyes*
Logged
DERP
new furball?

Black Wolf

*
Offline Offline

Gender: Male
Regina, Saskatchewan
Posts: 30


« Reply #1 on: November 14, 2009, 11:30:32 PM »

i dont know any official programming... and yet.. i manage to write scripts and "programs" that actually work!... they are just pretty much circulating scripts... anyway... sorry can't help you... i could print it off and ask my comp teacher... (he's memorized C++ Programming)





(i make things without knowing it... including a small OS >_>... damn.. i have too much time on my hands)
Logged

DERP
SenSint
fuzzy wuzzy

Kitsune-Neko-Wolf kit-pup

**
Offline Offline

Gender: Male
Ajax, Ontario
Posts: 70


« Reply #2 on: November 17, 2009, 02:28:33 PM »

ah well it's ok, I'm not taking that anymore
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!