Skip to content

Commit e2583b9

Browse files
committed
MODE 3d support
1 parent 7f4bc3b commit e2583b9

File tree

1 file changed

+18
-0
lines changed
  • src/main/java/com/falsepattern/jfunge/interpreter/instructions/fingerprints

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ public static void west(ExecutionContext ctx) {
7575
public static void north(ExecutionContext ctx) {
7676
ctx.IP().delta.add(0, -1, 0);
7777
}
78+
79+
@Instr('h')
80+
public static void high(ExecutionContext ctx) {
81+
if (ctx.dimensions() == 3) {
82+
ctx.IP().delta.add(0, 0, 1);
83+
} else {
84+
ctx.interpret('r');
85+
}
86+
}
87+
88+
@Instr('l')
89+
public static void low(ExecutionContext ctx) {
90+
if (ctx.dimensions() == 3) {
91+
ctx.IP().delta.add(0, 0, -1);
92+
} else {
93+
ctx.interpret('r');
94+
}
95+
}
7896
}
7997

8098
@NoArgsConstructor(access = AccessLevel.PRIVATE)

0 commit comments

Comments
 (0)