15 puzzle implemented in Ruby