function plot_triangles( tri )
%PLOT_TRIANGLES Draw the environment generated by generate_env
hold on;

% Plot first side of first triangle
plot([tri(1,1) tri(1,3)], [tri(1,2) tri(1,4)], 'k--');
axis equal;
% Then plot second and third sides of all triangles (one side is shared)
for i = 1:size(tri)
    xy = reshape(tri(i,:), 2, 3);
    x = circshift(xy(1,:), -1);
    y = circshift(xy(2,:), -1);
    h = plot(x, y, 'k--');
end

   

% Add text annotation
text(-21, 1, 'Start', 'FontSize', 14);
text(tri(end, 5)+1, tri(end, 6), 'Goal', 'FontSize', 14);
if tri(end,5) > 0
    xlim([-23, tri(end,5)+10]);
end
end

