added write to file method

write to file method added to maze_solver.rb