InterviewSolution
| 1. |
Solve : goto issues? |
|
Answer» You need to define enter at the top of your code. i defined enter at the top but it is displaying everything like i had said before in the previous replyI didn't see it. Overall, your CH looks good. I still think you will do better in Ch rater than batch. Butch is weird. Give me some time to run over your Ch code. If you are going to program this in another language then please report this post and ask the moderators to move this thread to that forum category.Quote from: Squashman on December 02, 2014, 07:48:58 PM If you are going to program this in another language then please report this post and ask the moderators to move this thread to that forum category.My apology for diverting this thread. I look at the C code the OP had and I see not reason to convert it to batch, other than the fact that distributing it is more work. But Ch and Tiny C are freeware programs and can be made available to anyone. Perhaps the OP will express his preference again. Quote from: Geek-9pm on December 02, 2014, 09:21:36 PM My apology for diverting this thread.i would like to go back to using Ch because it is an ok program to use.. and i can work on it at school because it is installed on the computers.. well one class.. i wish the library would have it so i can work on it there. i could pull out a 32bit pc and download Ch to my flash drive and use it off of it because i have the 64bit that i use on my flash drive already.The 32 bit version works on any Windows computer. After finding the error with enter it runs NORMALLY. Ch can be installed on a flash drive and run on any Windows PC. For all piratical purposes it is a portable program and does not need to alter the system environment. Provided you put your source code in the same directory. Glad to hear you school is using an interpreter to teach programming. After about twenty years the schools are now HELPING students learn TOOLS that are relevant to the current state of the art in the commercial world. MODERATOR. Can the thread be moved into programming? Quote from: Geek-9pm on December 03, 2014, 12:58:39 PM MODERATOR. Can the thread be moved into programming?That is what the Report to Moderator link is for.Quote from: Squashman on December 03, 2014, 01:59:38 PM That is what the Report to Moderator link is for.OK. Did it. Quote from: Geek-9pm on December 03, 2014, 12:58:39 PM The 32 bit version works on any Windows computer. After finding the error with enter it runs normally. Ch can be installed on a flash drive and run on any Windows PC. For all piratical purposes it is a portable program and does not need to alter the system environment. Provided you put your source code in the same directory.the 32 bit version wouldn't work on my 64 bit pc... and there is obviously a problem with the code because it is outputting everything at once after I do 1 and then 1 again...(The OP is now doing his game in Ch, a fast interpreter that conforms to C99 rules. His code now is free of syntax error, but has logical errors.) I will check the the 32 bit version of Ch on my other machine. I think it should work. Here is the revised code from the OP. ( sent it via PM) Code: [Select]/*File: interactive story*/ #include <stdio.h> int main () { int house; int forest; int poster; int knock; int thinking; int enter; printf("you are in an open forest west of a big abandoned house.\n"); printf("you can see that the front door is boarded up one window is open\n"); printf("there is a poster\n"); printf("if you want to look at poster type 1 if you want to pass press 2\n"); scanf("%d", &poster); if (poster == 1); { printf("Welcome to the interactive story of idk!\n"); printf("\n"); printf("you can explore a haunted house or a forest in this chapter\n"); printf("\n"); printf("you are in an open forest west of a big abandoned house.\n"); printf("you can see that the front door is boarded up one window is open\n"); printf("if you want to go into the spooky house press 1\n"); printf("if you want to go to the forest press 2\n"); scanf("%d", &house); scanf("%d", &forest); if (house == 1); { printf("you are walking up to the white house.\n"); printf("you hear a noise inside. do you want to knock or enter? 1 for knock or 2 for enter.\n"); scanf("%d", &knock); if(knock == 1); { printf("a big unknown thing breaks down the door and eats you whole. you are dead!\n"); } if(enter == 2); { printf("you open the door and see this tall boney grey thing sitting\n"); printf("on the floor eating something fleshy.\n"); printf("you see a shotgun leaning up against a rocking chair. you are thinking about\n"); printf("picking up the shotgun and shooting it or try to reason with it. 1 for reason or 2 for shoot\n"); scanf("%d", &thinking); if(thinking == 1); { printf("you say hello and asks what he is doing and it says not a word and rips you in two.\n"); printf("bad ending\n"); } if(thinking == 2); { printf("you run and grab the shotgun. the big grey thing turns and looks at you as you blow its head off."); } } } } } Looks like he has too many left brackets. Anybody? |
|