Esempio 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();
        }
Esempio 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);
        }