Game won't play again!

Hi, I've recently coded a small text based game. Everything works great except for my game won't play again. I've tried multiple methods but none seem to work any how here's the code.

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
#include <iostream>
#include <cstdlib>
#include <time.h>

using namespace std;

int main()
{
    int gameselect;
    bool playagain = true;
    char playagainchar;

    cout<<"Welcome to: \n\n";
    cout<<"*****************\n";
    cout<<"**Ryan's Casino**\n";
    cout<<"*****************\n";
    cout<<"Great Family Fun!\n\n";
    cout<<"Please select a game\n";
    cout<<"1. Guess a Number\n";
    cout<<"More games coming soon!\n";
    cout<<"What game would you like to play (Game Number): ";
    cin>> gameselect;
    cin.ignore();
    cout<<"\n\n\n";

    if (gameselect == 1){
            int select;

            cout<<"Welcome to Guess a Number\n";
            cout<<"1. Rules\n";
            cout<<"2. Play\n\n";
            cout<<"Please select: ";
            cin>> select;
            cin.ignore();
            cout<<"\n\n";

            switch ( select ) {

                case 1:

                    cout<<"In Guess a Number, your goal is to guess a randomly generated number \nbetween 1 and 1000.";
                    cout<<"Every time you guess the computer will tell \nyou if you are above or below.\n";
                    cout<<"Press enter to play!";
                    cin.get();
                    cout<<"\n\n";

                case 2:

                    while (playagain == true){
                    int guess, number, nog;
                    nog = 1;

                    srand ( time(NULL) );

                    number = rand() % 1000 + 1;

                    cout << "Guess a number: " ;
                    cin>> guess;

                    if (guess == number){

                        cout<<"You guessed it! \nit took you"<<nog<<"guesses";

                    }

                    if (guess<number) {
                        cout<<"You're guess was to low! \n";
                }
                    if (guess>number) {
                        cout<<"You're guess was to high! \n";
                    }

                    while (guess != number) {
                        cout<<"Guess again: ";
                        cin>>guess;
                        if (guess<number) {
                        cout<<"You're guess was to low! \n" ;
                }
                    if (guess>number) {
                        cout<<"You're guess was to high! \n";
                    }
                    nog++;
                    }
                    cout<<"You guessed it! In "<<nog<<" guesses!\n\n";
                    cout<<"Would you like to play again Y/N: ";
                    cin>>playagainchar;
                    cout<<"\n\n";
                    if(playagainchar != 'y') playagain = false;

                    break;
            }
    }
    cin.get();
}
}


All help would be appreciated.

Thanks,
Ryan
You have a break on line 90. That breaks the while loop, so it won't play again no matter what.
Thanks for the help I can't believe i missed that!
Topic archived. No new replies allowed.