close all

f_0 = '0';
f_1 = '01';
n = 20;

angle = 0;
curr_pos = [5 5];
segment_length = 3;
for i=3:n
    f_next = [f_1 f_0];
    %Use f_next to do any drawing that you want to do here
    f_0 = f_1;
    f_1 = f_next;
end
f=0;
for j=1:length(f_next)
        switch f_next(j)
            case '0'
                curr_pos = draw_angle_segment(segment_length, curr_pos, angle);
            case '1'
               if mod(j,2)==0
                    angle = change_angle(angle, 2);
                else
                    angle = change_angle(angle, 4);
                end
                curr_pos = draw_angle_segment(segment_length, curr_pos, angle);
        end       
        %disp(f_next(j));
        %disp(angle);
        if(mod(j,10)==0 || j==1 || j==2 || j==3 ||j==4 || j==5)
            f=f+1;
            saveas(gcf, ['fractal_',num2str(f,'%03d'),'.png']);
        end
end