title: How to make a bool loop within console c++?
body: <p>I am trying to do a simple game within console with c++.
  Everything went perfect, but I cant just get the bool &quot;fishing&quot; looped. It just returns 0 after the first session of &quot;fishing&quot;.
  Here's my code</p>
  <pre><code> fishing = false;
                
              if (fishing == false) {
                  system(&quot;cls&quot;);
                  cout &lt;&lt; &quot;Do you wish to fish again?&quot; &lt;&lt; endl;
                  cout &lt;&lt; &quot;Current Amount of fish: &quot;;
                  cout &lt;&lt; fish &lt;&lt; endl;
                  cin &gt;&gt; hellyea;
                  if (hellyea == 1)
                      fishing = true;
              }
  
              while (fishing == true) {
  
                  // the &quot;waiting to catch a fish&quot; part
  
  
                  // randomly selecting type of fishes
                  system(&quot;cls&quot;);
                  srand(time(NULL));
                  auto fishtype = rand() % 3;
  
                  if (fishtype == 0) {
                      system(&quot;cls&quot;);
                      cout &lt;&lt; &quot;You just got an: &quot; &lt;&lt; &quot;Common Carp!&quot; &lt;&lt; endl;
                      fish++;
                      cout &lt;&lt; &quot;Your Fish Amount: &quot;;
                      SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_INTENSITY);
                      cout &lt;&lt; fish &lt;&lt; endl;
                      SetConsoleTextAttribute(hConsole, saved_colors);
                      Sleep(2000);
  
                  }
                  if (fishtype == 1) {
                      system(&quot;cls&quot;);
                      cout &lt;&lt; &quot;Argh! You just found: &quot; &lt;&lt; &quot;A bag Of Trash!&quot; &lt;&lt; endl;
                      cout &lt;&lt; &quot;You lose 1 fish :(&quot; &lt;&lt; endl;
                      fish = fish - 1;
                      if (fish == -1)
                          fish++;
                      cout &lt;&lt; &quot;Your Fish Amount: &quot;;
                      SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_INTENSITY);
                      cout &lt;&lt; fish &lt;&lt; endl;
                      SetConsoleTextAttribute(hConsole, saved_colors);
                      Sleep(2000);
                  }
                  if (fishtype == 2) {
                      system(&quot;cls&quot;);
                      cout &lt;&lt; &quot;You just got an: &quot; &lt;&lt; &quot;Gold Fish! Congrats!&quot;;
                      fish++;
                      cout &lt;&lt; &quot;Your Fish Amount: &quot;;
                      SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_INTENSITY);
                      cout &lt;&lt; fish &lt;&lt; endl;
                      SetConsoleTextAttribute(hConsole, saved_colors);
                      Sleep(2000);
                  }
                  fishing = false;
              }
  </code></pre>