Simple Turing machine emulator in Ruby