Never ending quest issue

How can I end this?
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
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int checkpoint = 0;

void r_NorthClearing()
{
    int choice3, r_Awakening(), r_CenterClearing();
    cout << "descriptive writing" << endl;
    cin >> choice3;
    if (choice3 == 1)
        r_CenterClearing();
    if (choice3 == 2)
        cout << "descriptive writing" << endl;
    r_Awakening();
    if (choice3 == 3)
        cout << "The sign is worn-looking, most of the image has become obscured by time. The only part you can make out is a small area on the top half, with a well in the middle. You groan in frustration, because this is the clearing you are currently standing in.\n\n\n" << endl;
    checkpoint += 1;
        r_NorthClearing();
}

void r_WesternClearing()
{
    int choice1, r_Awakening(), r_CenterClearing();
    cout << "descriptive writing" << endl;
    cin >> choice1;
    if (choice1 == 1)
        r_CenterClearing();
    else
        cout << "descriptive writing" << endl;
    checkpoint += 1;
    r_Awakening();
}

void r_SouthernClearing()
{
    int choice1, r_CenterClearing(), r_Awakening();
    cout << "descriptive writing" << endl;
    cin >> choice1;
    if (choice1 == 1)
        r_CenterClearing();
    if (choice1 == 2)
        cout << "As you walk around the shack, you notice more, deeper scratches in the wall. You turn the corner, and the sight is nothing like you expected: An unnatural creature lies at the back door to the shack, its torso bristling with knives and other sharp kitchen impliments. The creature's head is wolf-like, ending in a terrifying snout, curled up in an unending growl. It's arms end in huge claws, which explain the scratches on the shack and benches. Its legs end in wolfish feet, and its body, as much as you can see, is covered in hair, as is the rest of this thing. You bend down closer to examine the monster's head, and hear a deep, growling noise from behind you. AS you slowly get up and turn around, your eyes grow wide as the dead monster's mate stands before you. She (you guess) is roughly nine feet tall, but slouching, her claws flex with restrained energy, and her eyes burn with more hatred than you believed possible: she blames you for her mate's death. You begin to back away, trying to explain how you came upon the corpse. She stops, and you think she's going to let you go. She suddenly leaps at you, snout agape. As you notice the gleaming fangs lining her maw, you have just enough time to wonder why this seems familiar as...\n\n\n" << endl;
    checkpoint += 1;
    r_Awakening();
}

void r_Tent()
{
    int r_CenterClearing();
    cout << "The inside of the tent is as you would expect, a single sleeping bag laying on the ground. There is also a pack lying open on the ground, and miscellaneous bits of camping equipment strewn about the interior of the tent. None of it seems needed to you, so you leave it where it is, in case the owner of the tent comes back." << endl;
    checkpoint += 1;
    r_CenterClearing();
}

void r_FirePit()
{
    int r_CenterClearing();
    cout << "After a quick analysis of the fire, consisting mostly of guesswork, you come to the conclusion that the pit was used recently. There may be markings in the dirt suggesting that there was at least one chair here recently. The pit itself is surrounded by small stones, and burned wood and ashes fill the space." << endl;
    checkpoint += 1;
    r_CenterClearing();
}

void r_EasternPath()
{
    cout << "A new path, leading to the east, beckons you. All at once, you remember everything. You reel back, as memories of countless deaths and rebirths flood your brain. Through the shock, you begin to understand what happened to change the way things are. After what seems like an eternity, you begin to regain control of yourself. The path beckons louder, and you listen, shackingly starting to walk down the path. As you leave the woods, questions begin to arise. Who else was there? What happened to them? What will you do now?" << endl;
    
}

void r_CenterClearing()
{
    int chioce4;
    cout << "You are in the middle of a wooded clearing. You don't remember anything before waking up, and decide to look around before going anywhere. You see a tent, firepit, and a nearby sign. The are also paths to the north, west, and south.\n What do you do?\n 1: Go north\n 2: Go west\n 3: Go south\n 4: Look at tent\n 5: look at fire pit\n 6: Look at sign\n" << endl;
    cin >> (checkpoint);
    if (checkpoint == 5)    
        r_EasternPath();        
    cin >> chioce4;
    if (chioce4 == 1)
        r_NorthClearing();
    else if (chioce4 == 2)
        r_WesternClearing();
    else if (chioce4 == 3)
        r_SouthernClearing();
    else if (chioce4 == 4)
        r_Tent();
    else if (chioce4 == 5)
        r_FirePit();
    else if (chioce4 == 6)
    {
    cout << "The sign is mostly unreadable, most of the map and wording worn by time. The only readable part is a clearing in the middle of the map, with a campground symbol. You groan is frustration, as this is the spot you are currently in." << endl;
    r_CenterClearing();
    }
    else
        cout << "That isn't an option. Look at the available answers and try again." << endl;
    while (chioce4 != 1 && chioce4 != 2 && chioce4 != 3 && chioce4 != 4 && chioce4 != 5) 
    {
        int choice5;
        cout << "That isn't an option. Look at the available answers and try again." << endl;
        cin >> choice5;
        if (choice5 == 1)
            r_NorthClearing();
        if (choice5 == 2)
            r_WesternClearing();
        if (choice5 == 3)
            r_SouthernClearing();
        if (choice5 == 4)
            r_Tent();
        if (choice5 == 5)
            r_FirePit();
        r_FirePit();
        if (choice5 == 6)
            cout << "The sign is mostly unreadable, most of the map and wording worn by time. The only readable part is a clearing in the middle of the map, with a campground symbol. You groan is frustration, as this is the spot you are currently in." << endl;
        r_CenterClearing();

    }
}


void r_Awakening()
{
    int choice1;
    cout << "You awaken in a wooded clearing. You don't remember anything before waking up, and decide to look around before going anywhere. You see a tent, firepit, and a nearby sign. The are also paths to the north, west, and south.\n What do you do?\n 1: Go north\n 2: Go west\n 3: Go south\n 4: Look at tent\n 5: look at fire pit\n 6: Look at sign\n" << endl;
    cin >> choice1;
   if (choice1 == 1)
        r_NorthClearing();
   else if (choice1 == 2)
        r_WesternClearing();
   else if (choice1 == 3)
        r_SouthernClearing();
   else if (choice1 == 4)
        r_Tent();
   else if (choice1 == 5)
        r_FirePit();
    else if (choice1 == 6)
        cout << "The sign is mostly unreadable, most of the map and wording worn by time. The only readable part is a clearing in the middle of the map, with a campground symbol. You groan is frustration, as this is the spot you are currently in." << endl;
        r_CenterClearing();
    
    if (choice1 != 1 && choice1 != 2 && choice1 != 3 && choice1 != 4 && choice1 != 5) 
    {
        
        cout << "That isn't an option. Look at the available answers and try again." << endl;
        cin >> choice1;
        if (choice1 == 1)
            r_NorthClearing();
        else if (choice1 == 2)
            r_WesternClearing();
        else if (choice1 == 3)
            r_SouthernClearing();
        else if (choice1 == 4)
            r_Tent();
        else if (choice1 == 5)
            r_FirePit();
        else if (choice1 == 6)
            cout << "The sign is mostly unreadable, most of the map and wording worn by time. The only readable part is a clearing in the middle of the map, with a campground symbol. You groan is frustration, as this is the spot you are currently in." << endl;
        r_CenterClearing();
    }
}
int main(void)
{
    r_Awakening();    
}    
I guess you mean line 96? That loop won't end since you don't modify 'chioce4'. Instead of wirting the same code twice (in/out of the loop) consider using a do { } while(...); loop
No, I mean in general. It works like it's supposed to, but it doesn't end after the Eastern Path opens up.
No, I mean in general
What?

but it doesn't end after the Eastern Path opens up
Reason:
I wrote:
That loop won't end since you don't modify 'chioce4'
So if 'chioce4' is not 1 - 5 it doesn't end
Topic archived. No new replies allowed.