| Summary: | Garbled characters shown in user interface | ||
|---|---|---|---|
| Product: | River-Crossing-Puzzle-Solver | Reporter: | tsunychau2-c |
| Component: | UI | Assignee: | tsunychau2-c |
| Status: | RESOLVED FIXED | ||
| Severity: | critical | ||
| Priority: | High | ||
| Version: | v0.9.5 | ||
| Hardware: | PC | ||
| OS: | Mac OS | ||
|
Description
tsunychau2-c
2022-11-05 18:37:18 HKT
Bug is confirmed.
The reason should be missing "AnsiConsole.systemInstall();".
Modification of code (Main.java inside folder Puzzle.UI):
package Puzzle.UI;
import java.util.*;
import org.fusesource.jansi.AnsiConsole;
public class Main{
public static void main(String[] args) {
AnsiConsole.systemInstall();
GameFlow m;
GameFlowFactory f = new GameFlowFactory();
Scanner s = new Scanner(System.in);
if(args.length > 0) {
if(args[0].equals("-s")) {
String jsonPath = args[1];
m = f.getGameFlow("1", jsonPath);
m.run();
}else if(args[0].equals("-p")) {
String jsonPath = args[1];
m = f.getGameFlow("2", jsonPath);
m.run();
}
}else {
ArrayList<String> commandList = new ArrayList<String>();
commandList.add("1");
commandList.add("2");
String mode;
do{
System.out.println("Please enter the number to select the mode: 1-Solver 2-One Player");
mode = s.next();
}while(!commandList.contains(mode));
m = f.getGameFlow(mode);
m.run();
}
s.close();
}
}
|