Maze Simulation in Ruby