Simulating a computer in ruby