title: Letter guessing game Java
body: <p>I have been working on a java guessing game for letters (a-z)! However i have created the game perfectly by using the number 1-26, but i cannot figure out how to convert each integer to a letter ie a = 1, b = 2,....z = 26! </p>
  
  <p>I want the user to try and guess the letter and not the number, but i cannot workout how to do this! </p>
  
  <p>(I know how to generate a random character but i cant implement and link it to each integer within the game correctly)</p>
  
  <pre><code>Random r = new Random();
  
  char targetLetter = (char)(r.nextInt(26) + 'a');       
  </code></pre>
  
  <p>Any help would be greatly appreciated! And i can display my code if it is needed</p>
  
  <pre><code>public class Stack {
  
      public static void main(String[] args) {
  
          Random rand = new Random(); //This is were the computer selects the Target
  
          int guess;
          int numGuesses = 0;
          int Target;
          String userName;
          String playagain;
          boolean play = true;
          int session = 0;
          int sessions = 0;
          int bestScore = 0;
  
          Scanner consoleIn = new Scanner(System.in);
          Scanner name = new Scanner(System.in);
  
          System.out.println("Hello! Please enter your name:\n"); //This is were the user enters his/her name
          userName = name.nextLine();
  
          System.out.println("Hello " + userName + " :) Welcome to the game!\n");
  
  
          while (play = true) {
              session++;
              Target = rand.nextInt(26) + 1;
              System.out.println("Guess a number between 1 and 26? You will have 5 attempts to guess the correct number"); //This is where the computer asks the user to guess the number and how many guesses they will have
  
              do {
                  guess = consoleIn.nextInt();
                  numGuesses++;
  
                  if (guess &gt; 26)
                      System.out.println("Error! Above MAXIMUM range");
                  else if (guess &lt;= 0)
                      System.out.println("Error! Below MINIMUM range");
                  else if (guess &gt; Target)
                      System.out.println("Sorry! Your guess was too high! :)"); //This is to help the player get to the answer
                  else if (guess &lt; Target)
                      System.out.println("Sorry! Your guess was too low! :)"); //This is to help the player get to the answer
              } while (guess != Target &amp;&amp; numGuesses &lt; 5);
  
              if (guess == Target) {
                  System.out.println("Congratulations " + userName + ", it took you " + numGuesses + " attempts to guess correctly!"); //This tells the player that they got the correct answer and how many attempts it took
                  sessions++;
              } else {
                  System.out.println("Sorry " + userName + ", You've used up all of your guesses! The correct answer was " + Target + "!");  //This tells the player that they failed to find the number and then tells them what the correct answer
              }
              {
                  Scanner answer = new Scanner(System.in);
                  System.out.println("Would you like another GO " + userName + "? [Y/N]");//This asks the player if they would like to play again
                  playagain = answer.nextLine();
                  if (playagain.equalsIgnoreCase("Y")) {//This is what happens if the player opts to play again
                      play = true;
                      numGuesses = 0;
                  } else if (playagain.equalsIgnoreCase("N")) {//This is what happens if the player opts to exit the game
                      play = false;
                      System.out.println("Thanks for playing " + userName + "! :) Please come back soon!");
                      System.out.println("You had  " + session + " Goes");
                      System.out.println("The number of times you guessed correctly: " + sessions + "");
                      break;
                  }
              }
          }
      }
  }
  </code></pre>