Help on school project

My project worked right up until i wrote about the "after three months" After that part the rest of the code wont work it's like there is a getch () there. it says there are no errors but that "1 up to date" any ideas? I did ask my teacher for permission before posting this but he is stumped to. I will be siting the website and the users that help me thanks.

========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;

int main()
{
    char name[50];
    cout << "What is your name?" << endl;
    cin.getline(name, 50);

		cout << "!!!----------------------Chapter One: Where am I?----------------------!!!" << endl;

	cout << "Stranger: Wake up! Hurry! Get up!" << endl;
	cout << "(You wake up startled)" << endl;
	cout << "You: What happened?" << endl;
	cout << "Stranger: No time, My guys will be arriving soon we have to hurry." << endl << endl;
	
	system ("pause");
	
    
	int choiceOne_Path;
    cout << "# What would you like to do?" << endl;
    cout << ">> Enter '1' I'm not going with you your crazy *Run away* " << endl;
    cout << ">> Enter '2' OK what ever you say but I demand an explanation when we get where ever we are going " << endl;


    cout << "\nEnter your choice: ";
    cin >> choiceOne_Path;
    if(choiceOne_Path == 1)

	{
		
	
	cout << "You run away before he can even say a word. You run right into a group of angry looking people brandishing weapons. Looks like you should have listened" << endl;
	
	cout << "*Dead* game over" << endl;

	system ("pause");

	return 0;
}
	
	
	else if (choiceOne_Path == 2)
	 {
	cout << "Stranger: You will have all the answears you need when we get out of here now lets get to my guys.";
	
	cout << "\n----------------------Press any key to continue----------------------" << endl;
	
	system ("pause");
	system("CLS");
	
	cout <<  "Stranger: Ok my guys are right up ahead" << endl;
	cout << "You: Let's just hurry this up I want to know whats going on" << endl << endl;

	system ("pause");
		system ("CLS");
		
}


 if (choiceOne_Path == 2)
{
	
	
	cout << "just as you are preparing to reach his guys you notice a snake in the road." << endl << endl;
	
	
    cout << "Enter '1' to attempt to kill the snake" << endl;
    cout << "Enter '2' to let the guy with the weapons kill it" << endl;



	
    cout << "\nEnter your choice: ";
    cin >> choiceOne_Path;

	system ("CLS");
    

	


}
if (choiceOne_Path == 1)
{
	
	
	cout << "The snake bites you with its large fangs. The venom drops you after two feet"<< endl << endl;

	cout << "*Dead* game over" << endl;

	system ("pause");

	return 0;


	
	getch ();
}
if (choiceOne_Path == 2)
{
	
	
	cout << "The stranger brandishing a great sword chops down the snake in one mighty swing."<< endl << endl;


system ("pause");

	cout << "Stranger: Very wise letting me take the snake, but now that i think about it you are a little under equip";
	cout << "*Stranger hands you a simple knife*"<< endl;

	cout << "Stranger: Only use it if you have to its old and flimbsy";
	cout << "You: Alright.";

	system ("pause");

		system ("CLS");

		cout << "After walking for what seems like ages you finally get out of the tunnel you were in. Infront of you in a large group of shady looking men" << endl;

	cout << "Enter '1' to do nothing" << endl;
    cout << "Enter '2' to charge the group of men with your new knife" << endl;
	cout << "Enter '3' to sneak away and wonder the woods." << endl;

	cout << "\nEnter your choice: ";
    cin >> choiceOne_Path;

}


if (choiceOne_Path == 1)
{
	
	
	
	cout << "You wait for something to happen.After about 3 seconds the stranger lets out a laugh."<< endl;
	cout<< " he walks over to them and talks for alittle before he tells you to come on."; 

	cout << "*You have escaped.";

	system ("pause");

	return 0;


	
	getch ();
}


if (choiceOne_Path == 2)
{
	
	
	cout << "You charge the group dagger in hand feeling brave. One pulls out a sword in impales you before you can do damage.You are dead."<< endl << endl;

	cout << "*Dead* game over" << endl;

	system ("pause");

	return 0;


	
	getch ();
}

				if (choiceOne_Path == 3)
{
	
	
	cout << "You sneak away quietly before anyone sees you"<< endl;
	cout<< "you start wondering the woods and before you have time to react a are being mualed by a grizzly." << endl;

	cout << "*Dead* Game over";

	system ("pause");

	return 0;


	
	getch ();
}

				if (choiceOne_Path == 1)
{
	
	
	
	cout << "You wait for something to happen.After about 3 seconds the stranger lets out a laugh."<< endl;
	cout<< " he walks over to them and talks for alittle before he tells you to come on." << endl << endl; 

	cout << "*You have escaped." << endl;

	system ("pause");

	system ("cls");

	cout << "Three months later....." << endl << endl;

	cout << " After getting to learn everyones name, you learn the stranger that helped you was named Rees" <<endl;
	cout << " He has been getting people like you that were thrown in jail and training them for his cause." << endl;
	cout << " The only thing he demands is the loyalty of his followers. If they didn't agree they went back to the slammer." << endl;
	cout << " You swore your life to helping his cause of slaying monsters that would do good folks harm";

	system ("pause");

	system ("cls");

	getch ();

	}
				}
Last edited on
Here with correct indentions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#include <iostream>
#include <stdlib.h>
using namespace std;

int main()
{
    char name[50];
    cout << "What is your name?" << endl;
    cin.getline(name, 50);
    
    cout << "!!!----------------------Chapter One: Where am I?----------------------!!!" << endl;
    
    cout << "Stranger: Wake up! Hurry! Get up!" << endl;
    cout << "(You wake up startled)" << endl;
    cout << "You: What happened?" << endl;
    cout << "Stranger: No time, My guys will be arriving soon we have to hurry." << endl << endl;
    
    system ("pause");
    
    
    int choiceOne_Path;
    cout << "# What would you like to do?" << endl;
    cout << ">> Enter '1' I'm not going with you your crazy *Run away* " << endl;
    cout << ">> Enter '2' OK what ever you say but I demand an explanation when we get where ever we are going " << endl;
    
    
    cout << "\nEnter your choice: ";
    cin >> choiceOne_Path;
    if(choiceOne_Path == 1)
    {
    	cout << "You run away before he can even say a word. You run right into a group of angry looking people brandishing weapons. Looks like you should have listened" << endl;
    	
    	cout << "*Dead* game over" << endl;
    	
    	system ("pause");
    	
    	return 0;
    }
    
    
    else if (choiceOne_Path == 2)
    {
    	cout << "Stranger: You will have all the answears you need when we get out of here now lets get to my guys.";
    	
    	cout << "\n----------------------Press any key to continue----------------------" << endl;
    	
    	system ("pause");
    	system("CLS");
    	
    	cout <<  "Stranger: Ok my guys are right up ahead" << endl;
    	cout << "You: Let's just hurry this up I want to know whats going on" << endl << endl;
    	
    	system ("pause");
    	system ("CLS");
    }
    
    
    if (choiceOne_Path == 2)
    {
    	cout << "just as you are preparing to reach his guys you notice a snake in the road." << endl << endl;
    	
    	
    	cout << "Enter '1' to attempt to kill the snake" << endl;
    	cout << "Enter '2' to let the guy with the weapons kill it" << endl;
    	
    	
    	
    	
    	cout << "\nEnter your choice: ";
    	cin >> choiceOne_Path;
    	
    	system ("CLS");
    }
    if (choiceOne_Path == 1)
    {
    	cout << "The snake bites you with its large fangs. The venom drops you after two feet"<< endl << endl;
    	
    	cout << "*Dead* game over" << endl;
    	
    	system ("pause");
	
	    return 0;
    }
    if (choiceOne_Path == 2)
    {
    	cout << "The stranger brandishing a great sword chops down the snake in one mighty swing."<< endl << endl;
    	
    	system ("pause");
    	
    	cout << "Stranger: Very wise letting me take the snake, but now that i think about it you are a little under equip";
    	cout << "*Stranger hands you a simple knife*"<< endl;
    	
    	cout << "Stranger: Only use it if you have to its old and flimbsy";
    	cout << "You: Alright.";
    	
    	system ("pause");
    	
    	system ("CLS");
    	
    	cout << "After walking for what seems like ages you finally get out of the tunnel you were in. Infront of you in a large group of shady looking men" << endl;
    	
    	cout << "Enter '1' to do nothing" << endl;
    	cout << "Enter '2' to charge the group of men with your new knife" << endl;
    	cout << "Enter '3' to sneak away and wonder the woods." << endl;
    	
    	cout << "\nEnter your choice: ";
    	cin >> choiceOne_Path;
    }
    
    
    if (choiceOne_Path == 1)
    {	
    	cout << "You wait for something to happen.After about 3 seconds the stranger lets out a laugh."<< endl;
    	cout<< " he walks over to them and talks for alittle before he tells you to come on."; 
    	
    	cout << "*You have escaped.";
    	
    	system ("pause");
    	
    	return 0;
    }
    if (choiceOne_Path == 2)
    {
    	cout << "You charge the group dagger in hand feeling brave. One pulls out a sword in impales you before you can do damage.You are dead."<< endl << endl;
    	
    	cout << "*Dead* game over" << endl;
    	
    	system ("pause");
    	
    	return 0;
    }
    
    if (choiceOne_Path == 3)
    {
    	cout << "You sneak away quietly before anyone sees you"<< endl;
    	cout<< "you start wondering the woods and before you have time to react a are being mualed by a grizzly." << endl;
    	
    	cout << "*Dead* Game over";
    	
    	system ("pause");
    	
    	return 0;
    }
    
    if (choiceOne_Path == 1)
    {
    	cout << "You wait for something to happen.After about 3 seconds the stranger lets out a laugh."<< endl;
    	cout<< " he walks over to them and talks for alittle before he tells you to come on." << endl << endl; 
    	
    	cout << "*You have escaped." << endl;
    	
    	system ("pause");
    	
    	system ("cls");
    	
    	cout << "Three months later....." << endl << endl;
    	
    	cout << " After getting to learn everyones name, you learn the stranger that helped you was named Rees" <<endl;
    	cout << " He has been getting people like you that were thrown in jail and training them for his cause." << endl;
    	cout << " The only thing he demands is the loyalty of his followers. If they didn't agree they went back to the slammer." << endl;
    	cout << " You swore your life to helping his cause of slaying monsters that would do good folks harm";
    	
    	system ("pause");
    	
    	system ("cls");
    }
}

(btw: why do you have a getch() after your return statements?
The application ends at the return 0 so your getch is not needed (that's why I removed it)
Furthermore, conio is deprecated but I guess your teacher doesn't know that)


The problem is simple, you have 2 blocks where you ask for option 1 in the last part (line 112 & 146)
the statement gets catched on line 112, at the end of that if-block you have a return 0 which means the programm is over

Just remove the if-block from line 112-122 (133-150 in your code) and it will work
Last edited on
To answer your question, you have two conditions for if (choiceOne_Path == 1). The first ends with a Return 0;

That seems to be the reason why the program never gets to the part about three months later.

Commenting out lines 133 - 150 gives more desired results.
Welcome on cplusplus.com mpacker :)
Thanks Gamer2015! I was looking for some new reading material and stumbled upon these forums. I figured I'd see if I could help anyone out.
Last edited on
Thanks for the help gamer2015! I was really getting bugged i couldn't find it. You most likely just helped save me a huge grade because everyone in here was stumped.
no problem, good luck :)

@mpacker, I had the same reason to join :>
Topic archived. No new replies allowed.