Skip to content

Commit 10b097c

Browse files
committed
high/low branch
1 parent e2583b9 commit 10b097c

File tree

1 file changed

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

1 file changed

+9
-0
lines changed

src/main/java/com/falsepattern/jfunge/interpreter/instructions/Funge98.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ public static void printChar(ExecutionContext ctx) {
197197
@Instr('|')
198198
public static void branchNorthSouth(ExecutionContext ctx) {ctx.interpret(ctx.IP().stackStack.TOSS().pop() == 0 ? 'v' : '^');}
199199

200+
@Instr('m')
201+
public static void branchHighLow(ExecutionContext ctx) {
202+
if (ctx.dimensions() == 3) {
203+
ctx.interpret(ctx.IP().stackStack.TOSS().pop() == 0 ? 'h' : 'l');
204+
} else {
205+
ctx.interpret('r');
206+
}
207+
}
208+
200209
@Instr('\'')
201210
public static void getNext(ExecutionContext ctx) {
202211
int i = ctx.fungeSpace().get(new Vector3i(ctx.IP().position).add(ctx.IP().delta));

0 commit comments

Comments
 (0)