title: Jeopardy Dice issue with displaying turn totals after both user and computer have gone
body: <p>So I have an issue with my code where I cannot get either of my functions (int human_turn, or int computer_turn) to return the correct value of their turn totals. What I am trying to do is have the two int functions return their respective turn totals after they are done with their turn, then have a separate function that will cout these values and will act as the scoreboard and also show if the win conditions are met. Currently at the end of the while loop for each ones turn, I have turnTotal_1 = roll_1 + turnTotal_1; which updates the total and then the loop checks to see if the while is still true. I then put a return turnTotal_1; statement after the loop so it would return this value, and it will always return 1. No matter what the value of the turn total is, the return statement will always return 1. any help or advice would be appreciated.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  #include &lt;cstdlib&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdio.h&gt;
  using namespace std; 
  
  /**
   * rollDie 
   * returns a random integer between 1 and 6, works as rolling a dice.
   * return value, int number (1-6)
   */
  
  int rollDie()
  {
      return random() % 6 + 1; 
  }
  
  
  int human_turn(int turnTotal_1)
  {
      cout &lt;&lt; "It is now human's turn" &lt;&lt; endl;
      cout &lt;&lt; "Do you want to roll a dice(Y/N)?:" &lt;&lt; endl;
      char user_choice;
      cin &gt;&gt; user_choice;
      while ((user_choice == 'y') || (user_choice == 'Y'))
      {
          int roll_1 = rollDie();
          if ((roll_1 == 2) || (roll_1 == 5))
          {
              cout &lt;&lt; "You rolled a " &lt;&lt; roll_1 &lt;&lt; endl;
              roll_1 = 0;
          }
          else if ((roll_1 == 1) || (roll_1== 3) ||(roll_1 == 6))
          {
              cout &lt;&lt; "You rolled a " &lt;&lt; roll_1 &lt;&lt; endl;
          }
          else if (roll_1 == 4)
          {
              cout &lt;&lt; "You rolled a " &lt;&lt; roll_1 &lt;&lt; endl;
              roll_1 = 15;
          }
          turnTotal_1 = roll_1 + turnTotal_1;
          cout &lt;&lt; "Your turn total is " &lt;&lt; turnTotal_1 &lt;&lt; endl;
          cout &lt;&lt; "Do you want to roll a dice(Y/N)?:" &lt;&lt; endl;
          cin &gt;&gt; user_choice;
      }
      if ((user_choice == 'n') || (user_choice == 'N')) 
      {
          return turnTotal_1;
      }
  }
  int computer_turn()
  {
      int turnTotal_2 = 0;
      cout &lt;&lt; "It is now computer's turn" &lt;&lt; endl;
      int roll_1 = rollDie();
      while (turnTotal_2 &lt;= 10)
      {
          int roll_1 = rollDie();
          if ((roll_1 == 2) || (roll_1 == 5))
          {
              cout &lt;&lt; "Computer rolled a " &lt;&lt; roll_1 &lt;&lt; endl;
              roll_1 = 0;
          }
          else if ((roll_1 == 1) || (roll_1== 3) ||(roll_1 == 6))
          {
              cout &lt;&lt; "Computer rolled a " &lt;&lt; roll_1 &lt;&lt; endl;
          }
          else if (roll_1 == 4)
          {
              cout &lt;&lt; "Computer rolled a " &lt;&lt; roll_1 &lt;&lt; endl;
              roll_1 = 15;
          }
          turnTotal_2 = roll_1 + turnTotal_2;
          cout &lt;&lt; "Computer turn total is " &lt;&lt; turnTotal_2 &lt;&lt; endl;
      }
  }
  void scoreboard()
  {
  cout &lt;&lt; human_turn &lt;&lt; endl;
  cout &lt;&lt; computer_turn &lt;&lt; endl;
  }
  
  void game()
  {
      cout &lt;&lt; "Welcome to Jeopardy Dice!" &lt;&lt; endl;
      human_turn(0);
      cout &lt;&lt; human_turn &lt;&lt; endl;;
      computer_turn();
      scoreboard();
  }
  
  
  int main()
  {
      // start the game! 
      game();
      return 0;
  }
  </code></pre>
  
  <p>Here is an example of how it runs.</p>
  
  <pre><code>Welcome to Jeopardy Dice!
  It is now human's turn
  Do you want to roll a dice(Y/N)?:
  n
  1
  It is now computer's turn
  Computer rolled a 5
  Computer turn total is 0
  Computer rolled a 4
  Computer turn total is 15
  </code></pre>