1
0
Files
Advent-of-Code/2019/src/main/java/be/vandewalleh/aoc/intcode/Mode.java
T
2020-12-31 00:52:18 +01:00

12 lines
350 B
Java

package be.vandewalleh.aoc.intcode;
public enum Mode {
Positional, Immediate;
public static Mode of(char representation) {
if (representation == '0') return Mode.Positional;
else if (representation == '1') return Mode.Immediate;
else throw new IllegalArgumentException("Unsupported Mode " + representation);
}
}