0

I already tried a seperate way as shown in what I tried, but it didnt output correctly.

    public static final String ANSI_RESET = "\u001B[0m";
    public static final String ANSI_RED = "\u001B[31m";
    public static final String ANSI_BLUE = "\u001B[34m";

After setting up the strings I tried to run it with this line:

        System.out.println(ANSI_RED + "Connect 4:" + ANSI_RESET);

And the output was :

[31mConnect 4:[0m

How could I do this correctly?

  • Could you clarify your question. it appears that code is running fine and it is giving expected output. – MoveFast Dec 19 '22 at 20:50
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 19 '22 at 20:50
  • 1
    In recent versions of Eclipse you can enable ANSI codes in the Preferences > Run/Debug > Console > ANSI Support – greg-449 Dec 19 '22 at 21:25

0 Answers0