Class: Brainfsck::VM
- Inherits:
-
Object
- Object
- Brainfsck::VM
- Defined in:
- lib/brainfsck/vm.rb
Constant Summary collapse
- MEM_SIZE =
1_024_000- DEBUGGING =
ENV["DEBUG"] == "1"
Instance Method Summary collapse
-
#initialize(program) ⇒ VM
constructor
A new instance of VM.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 |
# File 'lib/brainfsck/vm.rb', line 17 def run while ip < program.length run_instruction(program[ip]) @ip += 1 end end |