Untitled

Anonymous
plain_text
02/10/2026 9:29 AM
1.1 KB
10
Indexable
#include <iostream>
using namespace std;

int main() {
    char ans;

    cout << "YES/NO ADVENTURE GAME\n";
    cout << "You are in a dark forest.\n";
    cout << "Do you follow the path? (y/n): ";
    cin >> ans;

    if (ans == 'y' || ans == 'Y') {
        cout << "\nYou find a small house.\n";
        cout << "Do you knock on the door? (y/n): ";
        cin >> ans;

        if (ans == 'y' || ans == 'Y') {
            cout << "\nA friendly person gives you food and shelter.\n";
            cout << "GOOD ENDING!\n";
        } else {
            cout << "\nYou walk away and get lost in the forest.\n";
            cout << "BAD ENDING!\n";
        }

    } else {
        cout << "\nYou leave the path and fall into a hidden hole.\n";
        cout << "BAD ENDING!\n";
    }

    return 0;
}
Editor is loading...
Leave a Comment