function [path_rows path_cols] = astar(map,start,goal)

start_row = start(1); 
start_col = start(2); 

goal_row = goal(1);
goal_col = goal(2);

% your Astar code goes here
% the rest of this file is junk and should be removed

if start_row == goal_row
    path_rows = start_row;
elseif start_row < goal_row
    path_rows = start_row:goal_row;
else
    path_rows = start_row:-1:goal_row;
end


if start_col == goal_col
    path_cols = start_col;
elseif start_col < goal_col
    path_cols = start_col:goal_col;
else
    path_cols = start_col:-1:goal_col;
end

if length(path_rows) > length(path_cols)
   path_cols(end+1:end+length(path_rows)-length(path_cols)) = goal_col;    
elseif length(path_rows) < length(path_cols)
   path_rows(end+1:end+length(path_cols)-length(path_rows)) = goal_row;   
end