Exemplo n.º 1
0
        public static void Run(string program, Func <int> read, Action <char> write, int memorySize = 30000)
        {
            var vm = new My_VirtualMachine(program, memorySize);

            My_BrainfuckBasicCommands.RegisterTo(vm, read, write);
            My_BrainfuckLoopCommands.RegisterTo(vm);
            vm.Run();
        }
Exemplo n.º 2
0
        private IVirtualMachine Vm(string program, int memorySize = 10)
        {
            var vm = new My_VirtualMachine(program, memorySize);

            My_BrainfuckBasicCommands.RegisterTo(vm, () => - 1, c => {});
            My_BrainfuckLoopCommands.RegisterTo(vm);
            vm.Run();
            return(vm);
        }