title: if/else statement inside of a while loop
body: <p>I've written a code for a game that simulates the user and the computer rolling a die and the winner receives 1$ from the loser, with each starting with 2$. The code runs fine, but it doesn't end when either the user or computer reaches 0$ like i had anticipated. Any suggestions?</p>
  
  <pre><code>import java.util.Scanner;
  
  public class ALE_04_RollDice {
  public static void main (String[] args) {
  
      Scanner input = new Scanner(System.in);
      int userMoney = 2;
      int compMoney = 2;
      int userRoll = (int) (1 + Math.random() * 6);
      int compRoll = (int) (1 + Math.random() * 6);
  
      System.out.print("Press 'r' if you would like to roll ");
      do {String roll = input.nextLine();
      if (roll.equals("r")); {
          if (userRoll &gt; compRoll){
              userMoney++;
              compMoney--;
       System.out.print("The computer rolled " + compRoll + " and you rolled "       + userRoll + ". you won."
          + "\n" + "You have $" + userMoney + " &amp; The computer has $" + compMoney);
              }
  
              else if (userRoll &lt; compRoll) {
                  compMoney++;
                  userMoney--;
                  System.out.print("The computer rolled " + compRoll + " and you rolled " + userRoll + 
                          ". you lost" + "\n" + "You have $" + userMoney + " &amp; The computer has $" + compMoney);
              }
  
              else {System.out.print("The computer rolled " + compRoll + "and you rolled " + userRoll + 
                      ". it's a tie" + "\n" + "You have $" + userMoney + " &amp; the computer has $" + compMoney);}
  
  
              }
              }while (userMoney &gt;= 0 || compMoney &gt;=0);
      }}
  </code></pre>