Skip to content

Commit bbe3bf2

Browse files
committed
copy new print code from fpdp to fpsp too
1 parent d7fb520 commit bbe3bf2

File tree

1 file changed

+5
-1
lines changed
  • src/main/java/com/falsepattern/jfunge/interpreter/instructions/fingerprints

1 file changed

+5
-1
lines changed

src/main/java/com/falsepattern/jfunge/interpreter/instructions/fingerprints/FPSP.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ public static void negate(ExecutionContext ctx) {
108108
@SneakyThrows
109109
@Instr('P')
110110
public static void print(ExecutionContext ctx) {
111-
ctx.output().write((PRINT_FORMAT.format(ctx.stack().popF())).getBytes(StandardCharsets.UTF_8));
111+
ctx.output()
112+
.write(PRINT_FORMAT.format(ctx.stack().popF())
113+
.replace("\uFFFD", "NaN ")
114+
.replace("\u221E", "infinity")
115+
.getBytes(StandardCharsets.UTF_8));
112116
}
113117

114118
@Instr('Q')

0 commit comments

Comments
 (0)