C++ | Game Stops after If statement : I run this code but when I reach the edge of the screen, it doesn't allow me to enter a new travel direction instead the console closes down.. need help fixing this please


    class weapon
    {
    public:
        weapon();
        weapon(int x, int y);
        int xPos;
        int yPos;
    
    };
    
    weapon::weapon()
    {
        xPos = 0;
        yPos = 0;
    }
    
    weapon::weapon(int x, int y)
    {
        xPos = x;
        yPos = y;
    }
    
    
    struct Game
    {
        weapon Bow;
        weapon Sword;
    };
    
    int main()
    {
        weapon * Bow = new weapon(4, 6);   // how to add cout to this to show you have the weapon?
    
        int xPos = 1;
        int yPos = 1;
        char input = '#';
    
    
        while (xPos >= 1 && xPos <= 20 && yPos >= 1 && yPos <= 20)
    
        {
            cout << "Current x-coord = " << xPos << " Current y-coord = " << yPos << endl;
            cout << "Which direction would you like to travel? Enter N, E, S or W" << endl;
            cin >> input;
    
            switch (input)
            {
            case 'E': case 'e':
                ++xPos;
                break;
            case 'W': case 'w':
                --xPos;
                break;
            case 'N': case 'n':
                ++yPos;
                break;
            case 'S': case 's':
                --yPos;
                break;
            }
            if (xPos <= 0 || xPos >= 21 || yPos <= 0 || yPos >= 21)
            {
                cout << "There is a wall in the way!" << endl;             //how do i make it continue the game after hitting a wall
                cout << "Which direction would you like to travel? Enter N, E, S or W" << endl;
                //cin >> input;     // this whole section needs some fixing
            }
        }
    
    
    
        return 0;
    }


The correct solution should return back to the while loop, allowing the user to enter a new input direction for travel 

thanks
