title: Display string horizontally or in row Java
body: <p>So I am working on a slot machine on Java using only the console. I have some strings with ASCII word art that must be displayed on blocks of three, horizontally, like a slot machine.</p>
  <pre><code>    static final String pera = &quot;  (     \n  / \\  \n (   ) \n  `\&quot;' \n       \n&quot;;
      static final String platan = &quot;       \n ,     \n \\`.__.\n  `._,'\n       \n&quot;;
      static final String raim = &quot; \\     \n ()() \n()()()\n ()() \n  ()  \n&quot;;
      static final String kiwi = &quot;       \n,=.    \n(.`:) \n `-'         \n&quot;;
      static final String penaut = &quot; ,+.   \n((|)) \n )|(  \n((|)) \n `-'  &quot;;
  </code></pre>
  <p>So right now this is the output<br>
  <a href="https://i.stack.imgur.com/BD6H9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BD6H9.png" alt="enter image description here" /></a><br>
  And I need it to look like this target output<br>
  <a href="https://i.stack.imgur.com/NaR7Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NaR7Y.png" alt="enter image description here" /></a><br>
  The problem is that the strings I'm using are not just 1 line strings, so the usuall methods to print on the same line doesn't work, like using print instead of println. Is this even possible to program on java?</p>
  <p>Complete code:</p>
  <pre><code>package Escurabutxaques;
  import java.util.Arrays;
  import java.util.Random;
  import java.util.Scanner;
  import java.util.concurrent.ThreadLocalRandom;
  
  public class Escurabutxaques {
      static boolean correcte = false;
      static String res1 = &quot;&quot;;
      static String res2 =&quot;&quot;;
      static String res3 = &quot;&quot;;
      static final String pera = &quot;  (     \n  / \\  \n (   ) \n  `\&quot;' \n       \n&quot;;
      static final String platan = &quot;       \n ,     \n \\`.__.\n  `._,'\n       \n&quot;;
      static final String raim = &quot; \\     \n ()() \n()()()\n ()() \n  ()  \n&quot;;
      static final String kiwi = &quot;       \n,=.    \n(.`:) \n `-'         \n&quot;;
      static final String penaut = &quot; ,+.   \n((|)) \n )|(  \n((|)) \n `-'  &quot;;
      public static void main (String[] Args){
          System.out.println(&quot;Benvingut a la màquina escurabutxaques de l'Andreu!&quot;);
          Random();
      }
      public static void Random() {
          for (int i = 0; i &lt; 3; ++i) {
              String print = &quot;&quot;;
              Random r = new Random();
              int randomNumber = ThreadLocalRandom.current().nextInt(1, 5 + 1);
              if (randomNumber == 1) {
                  print = pera;
                  switch (i){
                      case 1:
                          res1 = print;
                          break;
                      case 2:
                          res2 = print;
                          break;
                      case 3:
                          res3 = print;
                          break;
                  }
              } else if (randomNumber == 2) {
                  print = raim;
                  switch (i){
                      case 1:
                          res1 = print;
                          break;
                      case 2:
                          res2 = print;
                          break;
                      case 3:
                          res3 = print;
                          break;
                  }
              } else if (randomNumber == 3) {
                  print = platan;
                  switch (i){
                      case 1:
                          res1 = print;
                          break;
                      case 2:
                          res2 = print;
                          break;
                      case 3:
                          res3 = print;
                          break;
                  }
              } else if (randomNumber == 4) {
                  print = kiwi;
                  switch (i){
                      case 1:
                          res1 = print;
                          break;
                      case 2:
                          res2 = print;
                          break;
                      case 3:
                          res3 = print;
                          break;
                  }
              } else if (randomNumber == 5) {
                  print = penaut;
                  switch (i){
                      case 1:
                          res1 = print;
                          break;
                      case 2:
                          res2 = print;
                          break;
                      case 3:
                          res3 = print;
                          break;
                  }
              };
              System.out.println(print);
              Random();
          }
      }
  }
  </code></pre>