title: How to track and move String from left to right?
body: <p>I'm making a racing game using Strings and I'm having trouble making them move to the right. How would I go about moving the Strings?
  Methods JamesMove() &amp; KeithMove() are the same as SusanMove(), just with the name of the variable are different.</p>
  
  <pre><code>public class NameRacer {
      public static  void nameRaces() {   
          Scanner scan = new Scanner(System.in);
          String response;
          int SusanFront, SusanBack, JamesFront, JamesBack, KeithFront, KeithBacck;
          boolean raceIsDone; 
          int move = (int)((Math.random() * 5) + 1);
          introduction();
          scan.nextLine();
          do {
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              SusanMove();
              JamesMove();
              KeithMove();
  
              System.out.println("Would you like to watch the race again?");
              response=scan.next();
      }
          while(response.equalsIgnoreCase("yes"));
      }
      private static void introduction() {
          System.out.println("This game races three names. The random number generator");
          System.out.println("from the Math class repeatedly gives each name a random number");
          System.out.println("between 1 and 5. As the names move these random distances");
          System.out.println("we see which name gets to the finish line first.");
          System.out.println("Press a key to begin the race.");
      }  
      private static void SusanMove() {
          String SusanFrontString="";
          String SusanBackString="";
  
          int SusanFront=50,SusanBack=0;
          int move = (int)((Math.random() * 5) + 1);
  
          SusanFront=SusanFront-move;
          SusanBack=SusanBack+move;
  
          for(int back = 0; back&lt;SusanBack;back++) {
              SusanBackString = SusanBackString+" ";
          }
          for(int front = 0; front&lt;SusanFront;front++) {
              SusanFrontString = SusanFrontString+" ";
          }
          String SusanRace = SusanBackString+"Susan"+SusanFrontString+"|";
          System.out.println(SusanRace);
      }
  </code></pre>
  
  <p>I expected an output something like this:</p>
  
  <pre><code>Susan                        |
  James                        |
  Keith                        |
  
     Susan                     |
   James                       |
       Keith                   |
  
         Susan                 |
         James                 |
            Keith              |
  </code></pre>
  
  <p>But instead I got:</p>
  
  <pre><code> Susan                       |
       James                   |
    Keith                      |
       Susan                   |
     James                     |
   Keith                       |
    Susan                      |
    James                      |
   Keith                       |
    Susan                      |
   James                       |
     Keith                     |
  </code></pre>