title: Difficulty navigating 2d String array that correlates to another 2d int array
body: <p>So I have a class that holds a bunch of stat info and such about a "gamer". I'm trying to implement a mock trophy system for certain stat goals that were achieved through an RNG.
  I have a 2d <code>int</code> array that holds values for the grade/level of the trophy, that once achieved upgrades the trophy from bronze, to silver, etc and a corresponding 2d <code>String</code> array that holds the titles of such trophy levels. In testing what seemed to work with a now unused method actually provided trophies to only certain types. What I have now is a path I think I need to follow in order for this to work. I have a method called <code>getBadges(int requestedStat)</code> that takes an index value for another array to view that stats trophies. In that method is a for loop that compares the method's argument to both 2d arrays to determine if the stat's value (stored in another array) qualifies it for a bronze, silver, or gold trophy. My main problem is I'm getting lost in how to access these different data points in my 2d arrays without going out of the index's range. Not to mention when I set up a bunch of <code>if-else</code> statements my test output always produced the trophy's name, but no trophy level. Like such:</p>
  
  <pre><code>Healer: No Badge 
  Explorer: No Badge 
  Socialite: No Badge 
  Contributor: No Badge 
  </code></pre>
  
  <p>As the skill points go up so should the badge levels (i.e. go from "No Badge" to "Bronze" etc). Is this a logic or syntax error? I'm super confused on what is happening in my code, despite my pseudo-code efforts. Here is the <code>Gamer</code> class:</p>
  
  <pre><code>package GamerProject;
  
  import java.io.Serializable;
  import java.util.Comparator;
  
  public class Gamer implements Serializable, Comparable&lt;Gamer&gt; {
  
      private String playerName;
      private static final int HEALTH_POINTS_RESD = 23;
      private static final int AREAS_VISITED = 200;
      private static final int PLAYERS_ENCOUNTERED = 175;
      private static final int MAPS_CREATED = 1500;
      private static final int ITEMS_GATHERED = 20;
      private static final int ITEMS_REPAIRED = 100;
      private static final int ITEMS_MERGED = 125;
      private static final int TOP_SCORES = 250;
      private static final int DMG_POINTS_DEALT = 17;
      private static final int MAPS_COMPLETED = 750;
      private static final int LEVEL2 = 10000;
      private static final int LEVEL3 = 25000;
      private static final int LEVEL4 = 80000;
      private static final int LEVEL5 = 150000;
      private static final int LEVEL6 = 300000;
      private static final int LEVEL7 = 1000000;
      private static final int LEVEL8 = 2200000;
      private static final int LEVEL9 = 4500000;
      private static final int LEVEL10 = 10000000;
      private static final int LEVEL11 = 20000000;
      private static final int LEVEL12 = 35000000;
      private final int[] gamerStatValues = new int[10];
      private final int[] gamerActions = {HEALTH_POINTS_RESD, AREAS_VISITED, PLAYERS_ENCOUNTERED, MAPS_CREATED,
          ITEMS_GATHERED, ITEMS_REPAIRED, ITEMS_MERGED, TOP_SCORES, DMG_POINTS_DEALT, MAPS_COMPLETED};
      private final int[] expValues = {LEVEL2, LEVEL3, LEVEL4, LEVEL5, LEVEL6, LEVEL7,
          LEVEL8, LEVEL9, LEVEL10, LEVEL11, LEVEL12};
      private final int[][] badgePoints = {
          {0, 2000, 10000, 30000, 100000, 200000},
          {0, 50, 1000, 5000, 17000, 40000},
          {0, 100, 1000, 2000, 10000, 30000},
          {0, 3, 10, 20, 90, 150},
          {0, 2000, 10000, 30000, 100000, 200000},
          {0, 100, 1000, 5000, 15000, 40000},
          {0, 100, 500, 2000, 10000, 40000},
          {0, 20, 200, 1000, 5000, 20000},
          {0, 2000, 10000, 30000, 100000, 300000},
          {0, 10, 50, 200, 500, 5000}};
      private final String[] badgeTitles = {"Healer: ", "Explorer: ", "Socialite: ", "Contributor: ",
          "Hoarder: ", "Fixer: ", "Joiner: ", "Leader: ", "Punisher: ", "Obsessed: ",};
      private final String[] badgeRanks = {"No Badge ", "Tin ", "Bronze ", "Silver ", "Gold ", "Platinum "};
  
      Gamer() {
          playerName = "";
  
      }
  
      public int getTotalExp() {
          int totalExp = 0;
          for (int i = 0; i &lt; gamerStatValues.length; i++) {
              totalExp += (gamerStatValues[i] * gamerActions[i]);
          }
          return totalExp;
      }
  
      public int getLevel() {
          int playerLevel = 1;
          int totalExp = getTotalExp();
          for (int i = 0; i &lt; expValues.length; i++) {
              if (totalExp &gt;= expValues[i]) {
                  playerLevel += 1;
                  //System.out.println(getTotalExp());
              }
          }
          return playerLevel;
      }
  
      public String getBadge(int requestedStat) {
          String badgeOutput = "";
          //index = 0;
          if (requestedStat &gt;= 0 &amp;&amp; requestedStat &lt;=9) {
              for (int i = 0; i &lt; badgeRanks.length; i++) {//not sure how to get around going out of the array bounds
                  if (gamerActions[requestedStat] &gt;= badgePoints[requestedStat][i]
                          &amp;&amp; gamerActions[requestedStat] &lt; badgePoints[requestedStat][i + 1]) {
                      badgeOutput = badgeTitles[requestedStat] + badgeRanks[i];
                  } else if (gamerActions[requestedStat] &gt;= badgePoints[requestedStat][i+1]
                          &amp;&amp; gamerActions[requestedStat] &lt; badgePoints[requestedStat][i + 2]) {
                      badgeOutput = badgeTitles[requestedStat] + badgeRanks[i+1];
                  }
              }
              //did this as an extraneous solution. Still doesn't work
  //            if (gamerActions[requestedStat] &gt;= badgePoints[requestedStat][index]
  //                        &amp;&amp; gamerActions[requestedStat] &lt; badgePoints[requestedStat][index + 1]) {
  //                    badgeOutput = badgeTitles[requestedStat] + badgeRanks[index];
  //                } else if (gamerActions[requestedStat] &gt;= badgePoints[requestedStat][index+1]
  //                        &amp;&amp; gamerActions[requestedStat] &lt; badgePoints[requestedStat][index + 2]) {
  //                    badgeOutput = badgeTitles[requestedStat] + badgeRanks[index+1];
  //                } else if (gamerActions[requestedStat] &gt;= badgePoints[requestedStat][index+2]
  //                        &amp;&amp; gamerActions[requestedStat] &lt; badgePoints[requestedStat][index + 3]) {
  //                    badgeOutput = badgeTitles[requestedStat] + badgeRanks[index+2];
  //                } else if (gamerActions[requestedStat] &gt;= badgePoints[requestedStat][index+3]
  //                        &amp;&amp; gamerActions[requestedStat] &lt; badgePoints[requestedStat][index + 4]) {
  //                    badgeOutput = badgeTitles[requestedStat] + badgeRanks[index+3];
  //                } else if (gamerActions[requestedStat] &gt;= badgePoints[requestedStat][index+4]
  //                        &amp;&amp; gamerActions[requestedStat] &lt; badgePoints[requestedStat][index + 5]) {
  //                    badgeOutput = badgeTitles[requestedStat] + badgeRanks[index+4];
  //                } else if (gamerActions[requestedStat] &gt;= badgePoints[requestedStat][index+5]
  //                        &amp;&amp; gamerActions[requestedStat] &lt; badgePoints[requestedStat][index + 6]) {
  //                    badgeOutput = badgeTitles[requestedStat] + badgeRanks[index+5];
  //                } else {
  //                    badgeOutput = badgeTitles[requestedStat] + badgeRanks[index+6];
  //                }
  //            
  
          } else {
              badgeOutput = "No Badges Available";
          }
          return badgeOutput;
      }
  
      //Incomplete Method
      public String getBadges() {
          String badgeOutput = "Badges: ";
          for (int i = 0; i &lt; badgeTitles.length; i++) {
  //            if (gamerActions[i]) {
  //                
  //            }
          }
          return badgeOutput;
      }
  
      public String getPlayerName() {
          return playerName;
      }
  
      public int getHealthPointsResd() {
          return gamerStatValues[0];
      }
  
      public int getAreasVisited() {
          return gamerStatValues[1];
      }
  
      public int getPlayersEncountered() {
          return gamerStatValues[2];
      }
  
      public int getMapsCreated() {
          return gamerStatValues[3];
      }
  
      public int getItemsGathered() {
          return gamerStatValues[4];
      }
  
      public int getItemsRepaired() {
          return gamerStatValues[5];
      }
  
      public int getItemsMerged() {
          return gamerStatValues[6];
      }
  
      public int getTopScores() {
          return gamerStatValues[7];
      }
  
      public int getDmgPointsDealt() {
          return gamerStatValues[8];
      }
  
      public int getMapsCompleted() {
          return gamerStatValues[9];
      }
  
      //Unused Method
      public void updateRandomGamerAction(int intValue) {
          if (intValue == 0) {
              gamerActions[0]+=1;
          } else if (intValue == 1) {
              gamerActions[1]+=1;
          } else if (intValue == 2) {
              gamerActions[2]+=1;
          } else if (intValue == 3) {
              gamerActions[3]+=1;
          } else if (intValue == 4) {
              gamerActions[4]+=1;
          } else if (intValue == 5) {
              gamerActions[5]+=1;
          } else if (intValue == 6) {
              gamerActions[6]+=1;
          } else if (intValue == 7) {
              gamerActions[7]+=1;
          } else if (intValue == 8) {
              gamerActions[8]+=1;
          } else {
              gamerActions[9]+=1;
          }
      }
  
      public String setPlayerName(String playerName) {
          this.playerName = playerName;
          return this.playerName;
      }
  
      public int setHealthPointsResd(int healthPointsResd) {
          if (healthPointsResd &gt;= 0) {
              gamerStatValues[0] = healthPointsResd;
              return gamerStatValues[0];
          } else {
              return gamerStatValues[0];
          }
      }
  
      public int setAreasVisited(int areasVisited) {
          if (areasVisited &gt;= 0) {
              gamerStatValues[1] = areasVisited;
              return gamerStatValues[1];
          } else {
              return gamerStatValues[1];
          }
      }
  
      public int setPlayersEncountered(int playersEncountered) {
          if (playersEncountered &gt;= 0) {
              gamerStatValues[2] = playersEncountered;
              return gamerStatValues[2];
          } else {
              return gamerStatValues[2];
          }
      }
  
      public int setMapsCreated(int mapsCreated) {
          if (mapsCreated &gt;= 0) {
              gamerStatValues[3] = mapsCreated;
              return gamerStatValues[3];
          } else {
              return gamerStatValues[3];
          }
      }
  
      public int setItemsGathered(int itemsGathered) {
          if (itemsGathered &gt;= 0) {
              gamerStatValues[4] = itemsGathered;
              return gamerStatValues[4];
          } else {
              return gamerStatValues[4];
          }
      }
  
      public int setItemsRepaired(int itemsRepaired) {
          if (itemsRepaired &gt;= 0) {
              gamerStatValues[5] = itemsRepaired;
              return gamerStatValues[5];
          } else {
              return gamerStatValues[5];
          }
      }
  
      public int setItemsMerged(int itemsMerged) {
          if (itemsMerged &gt;= 0) {
              gamerStatValues[6] = itemsMerged;
              return gamerStatValues[6];
          } else {
              return gamerStatValues[6];
          }
      }
  
      public int setTopScores(int topScores) {
          if (topScores &gt;= 0) {
              gamerStatValues[7] = topScores;
              return gamerStatValues[7];
          } else {
              return gamerStatValues[7];
          }
      }
  
      public int setDmgPointsDealt(int dmgPointsDealt) {
          if (dmgPointsDealt &gt;= 0) {
              gamerStatValues[8] = dmgPointsDealt;
              return gamerStatValues[8];
          } else {
              return gamerStatValues[8];
          }
      }
  
      public int setMapsCompleted(int mapsCompleted) {
          if (mapsCompleted &gt;= 0) {
              gamerStatValues[9] = mapsCompleted;
              return gamerStatValues[9];
          } else {
              return gamerStatValues[9];
          }
      }
  
      public void setStatsToZero(){
          for (int i = 0; i &lt; gamerActions.length; i++) {
              gamerActions[i] = 0;
          }
      }
      public String statsString() {
          return "Stats: " + "Health Points Restored = " + gamerStatValues[0]
                  + ",\n Areas Visited = " + gamerStatValues[1] + ", PlayersEncountered = " + gamerStatValues[2]
                  + ", Maps Created = " + gamerStatValues[3] + ",\n Items Gathered = " + gamerStatValues[4]
                  + ", Items Repaired = " + gamerStatValues[5] + ", Items Merged = " + gamerStatValues[6]
                  + ",\n Top Scores = " + gamerStatValues[7] + ", Damage Points Dealt =  " + gamerStatValues[8]
                  + ", Maps Completed = " + gamerStatValues[9] + '}';
      }
  
      public String shortDecription() {
          return String.format("%16s: Level %2d, Experience Points: %,10d",
                  playerName, this.getLevel(), this.getTotalExp());
      }
  
      @Override
      public String toString() {
          return "Gamer{" + "Player Name = " + playerName + " Player Stats: "
                  + "Health Points Restored = " + gamerStatValues[0]
                  + ",\n Areas Visited = " + gamerStatValues[1] + ", PlayersEncountered = " + gamerStatValues[2]
                  + ", Maps Created = " + gamerStatValues[3] + ",\n Items Gathered = " + gamerStatValues[4]
                  + ", Items Repaired = " + gamerStatValues[5] + ", Items Merged = " + gamerStatValues[6]
                  + ",\n Top Scores = " + gamerStatValues[7] + ", Damage Points Dealt =  " + gamerStatValues[8]
                  + ", Maps Completed = " + gamerStatValues[9] + '}';
      }
  
      @Override
      public int compareTo(Gamer player) {
          if (this.getTotalExp() &gt; player.getTotalExp()) {
              return 1;
          } else if (this.getTotalExp() == player.getTotalExp()) {
              return 0;
          } else {
              return -1;
          }
      }
  
  }
  </code></pre>
  
  <p>and here is the driver I'm testing it with:</p>
  
  <pre><code>package GamerProject;
  
  import java.util.Random;
  
  public class Program7Driver {
  
      private static final int rngRange = 10;
      private static final Gamer[] gamers = new Gamer[10];
      private static final String[] gamerNames = {"BestGamer99", "CdrShepardN7",
          "Gandalf_The_Cool", "SharpShooter01", "TheDragonborn", "SithLord01",
          "MrWolfenstien", "Goldeneye007", "DungeonMaster91", "MasterThief","TheDarkKnight"};
  
  
  
      public static void main(String[] args) {
          Random rand = new Random();
          for (int i = 0; i &lt; gamers.length; i++) {
              gamers[i] = new Gamer();
              gamers[i].setPlayerName(gamerNames[i]);
              gamers[i].setStatsToZero();
  
          }
  //        for (int i = 0; i &lt; 200000; i++) {
  //            int rng = rand.nextInt(rngRange);
  //            gamers[rng].setRandomGamerAction(rng);
  //        }
          int count = 0;
          for (int i = 0; i &lt; 20000; i++) {
              int rng = rand.nextInt(rngRange);
              System.out.println(gamers[0].getBadge(count));
              //System.out.println(gamers[0].toString());
              //gamers[0].updateRandomGamerAction(rng);
              if (rng == 0) {
                  gamers[0].setHealthPointsResd(gamers[0].getHealthPointsResd()+1);
              } else if (rng == 1) {
                  gamers[0].setAreasVisited(gamers[0].getAreasVisited()+1);
              } else if (rng == 2) {
                  gamers[0].setPlayersEncountered(gamers[0].getPlayersEncountered()+1);
              } else if (rng == 3) {
                  gamers[0].setMapsCreated(gamers[0].getMapsCreated()+1);
              } else if (rng == 4) {
                  gamers[0].setItemsGathered(gamers[0].getItemsGathered()+1);
              } else if (rng == 5) {
                  gamers[0].setItemsRepaired(gamers[0].getItemsRepaired()+1);
              } else if (rng == 6) {
                  gamers[0].setItemsMerged(gamers[0].getItemsMerged()+1);
              } else if (rng == 7) {
                  gamers[0].setTopScores(gamers[0].getTopScores()+1);
              } else if (rng == 8) {
                  gamers[0].setDmgPointsDealt(gamers[0].getDmgPointsDealt()+1);
              } else  {
                  gamers[0].setMapsCompleted(gamers[0].getMapsCompleted()+1);
              }
  
              count += 1;
              if (count == 10) {
                  count -= 10;
              }
             // System.out.println(gamers[i].statsString());     
          }
      }
  }
  </code></pre>