pub const Self = enum(u2) {
left = 0,
up = 1,
right = 2,
down = 3,
const OPP: u2 = @enumToInt(Self.left) ^ @enumToInt(Self.right);
pub fn opp(self: Self) Self {
return @intToEnum(Self, OPP ^ @enumToInt(self));
}
pub fn xor(self: Self, other: Self) u2 {
return @enumToInt(self) ^ @enumToInt(other);
}
pub fn sub(self: *Self, other: u2) void {
self.* = @intToEnum(Self, @enumToInt(self.*) ^ other);
}
comptime {
if (Self.down.opp() != Self.up) @compileError("WRONG");
}
};
pub const arrows = "<^>V";
pub const pipes = " lqml kxqk jmxj";
pub usingnamespace Self;