public static void RegisterTo(IVirtualMachine vm) { var pairs = vm.FindLoopPairs(); vm.RegisterCommand('[', b => { if (b.GetCell() == 0) { b.InstructionPointer = pairs[b.InstructionPointer]; } }); vm.RegisterCommand(']', b => { if (b.GetCell() != 0) { b.InstructionPointer = pairs[b.InstructionPointer]; } }); }