title: The value changed is never used
body: <p>My question is why variables for 'Life' won't work even if I think I did it right?<br />
  I have main method and in it:</p>
  <pre class="lang-java prettyprint-override"><code>        int destroyer1Life = 4;
          int destroyer2Life = 4;
          int battleShipLife = 5;
          int gameBoardLenght = 10;
          int shipsLife = destroyer1Life + destroyer2Life + battleShipLife;
  
          while(shipsLife &gt; 0){  //ships life is warned as always true
  
              char locationViewUpdate = evaluateGuessAndGetTarget(guessLocation, gameBoard, water, hit, miss, destroyer1, destroyer2, battleShip,battleShipLife, destroyer1Life, destroyer2Life, ship );
              if (shipsLife == 0){  //ships life is warned as always false
                  System.out.print(&quot;You won&quot;);
              }
  </code></pre>
  <p>In another method I have:</p>
  <pre class="lang-java prettyprint-override"><code>    private static char evaluateGuessAndGetTarget(int[] guessLocation, char[][] gameBoard, char water, char hit, char miss, char destroyer1, char destroyer2, char battleShip, int battleShipLife, int destroyer1Life, int destroyer2Life,char ship) {
  
          if (target == destroyer1){
              if (destroyer1Life &gt; 0){
                  target = hit;
                  message = &quot;Hit!&quot;;
                  destroyer1Life--; //The value changed at 'destroyer1Life--' is never used 
              }
          }
  
          if (target == destroyer2){
              if (destroyer2Life &gt; 0){
                  target = hit;
                  message = &quot;Hit!&quot;;
                  destroyer2Life--;  //The value changed at 'destroyer2Life--' is never used 
              }
          }
  
          if (target == battleShip){
              if (battleShipLife &gt; 0){
                  target = hit;
                  message = &quot;Hit!&quot;;
                  battleShipLife--;  //The value changed at 'battleShipLife--' is never used 
              }
          }
  }
  </code></pre>
  <p>So, even when I get an update on board that ship has been changed into hit, life wont go down.
  Full code: <a href="https://github.com/Mertyon/BattleShipsGame/blob/main/src/com/company/BattleShipsGame.java" rel="nofollow noreferrer">https://github.com/Mertyon/BattleShipsGame/blob/main/src/com/company/BattleShipsGame.java</a></p>